2017-09-26 08:59:34 +02:00
|
|
|
CC=gcc
|
2018-02-16 13:43:30 +01:00
|
|
|
OPT=-O3 -Wall -std=gnu99
|
2017-11-11 20:52:12 +01:00
|
|
|
OPT_PRO=-DTIC80_PRO
|
2017-11-21 18:34:01 +01:00
|
|
|
BIN_NAME= bin/tic80
|
2017-09-26 08:59:34 +02:00
|
|
|
|
2018-01-19 22:25:54 +01:00
|
|
|
3RD_PARTY = 3rd-party
|
2018-01-10 12:45:53 +01:00
|
|
|
DUKTAPE_LIB = $(3RD_PARTY)/duktape-2.2.0/src
|
2018-01-10 15:11:22 +01:00
|
|
|
BLIPBUF_LIB = $(3RD_PARTY)/blip-buf
|
2018-01-10 15:36:49 +01:00
|
|
|
SDL_NET_LIB = $(3RD_PARTY)/SDL2_net-2.0.1
|
|
|
|
|
2018-01-10 14:05:49 +01:00
|
|
|
PRE_BUILT = $(3RD_PARTY)/pre-built
|
2018-01-10 10:30:19 +01:00
|
|
|
|
2017-09-26 08:59:34 +02:00
|
|
|
RM= rm -f
|
|
|
|
|
|
|
|
INCLUDES= \
|
2018-01-10 10:30:19 +01:00
|
|
|
-I$(3RD_PARTY)/lua-5.3.1/src \
|
2018-07-11 12:03:03 +02:00
|
|
|
-I$(3RD_PARTY)/zlib-1.2.11 \
|
2018-01-10 10:30:19 +01:00
|
|
|
-I$(3RD_PARTY)/giflib-5.1.4/lib \
|
|
|
|
-I$(3RD_PARTY)/SDL2-2.0.7/include \
|
2018-02-19 11:13:44 +01:00
|
|
|
-I$(3RD_PARTY)/sdl-gpu/include \
|
2018-02-05 14:52:55 +01:00
|
|
|
-I$(3RD_PARTY)/wren-0.1.0/src/include \
|
2018-01-11 05:57:14 +01:00
|
|
|
-I$(3RD_PARTY)/moonscript \
|
2018-05-16 05:33:57 +02:00
|
|
|
-I$(3RD_PARTY)/fennel \
|
2018-08-03 00:17:40 +02:00
|
|
|
-I$(3RD_PARTY)/squirrel3.1/include \
|
2018-01-10 15:11:22 +01:00
|
|
|
-I$(BLIPBUF_LIB) \
|
2018-01-10 12:45:53 +01:00
|
|
|
-I$(DUKTAPE_LIB) \
|
2018-01-10 15:36:49 +01:00
|
|
|
-I$(SDL_NET_LIB) \
|
2018-01-10 10:30:19 +01:00
|
|
|
-Iinclude
|
2017-09-26 08:59:34 +02:00
|
|
|
|
|
|
|
MINGW_LINKER_FLAGS= \
|
2018-01-10 14:05:49 +01:00
|
|
|
-L$(PRE_BUILT)/mingw \
|
2017-09-26 08:59:34 +02:00
|
|
|
-lmingw32 \
|
|
|
|
-lcomdlg32 \
|
|
|
|
-lws2_32 \
|
2018-02-22 13:32:06 +01:00
|
|
|
-lsdlgpu \
|
2018-02-19 11:13:44 +01:00
|
|
|
-lSDL2main \
|
|
|
|
-lSDL2 \
|
|
|
|
-lopengl32 \
|
2017-09-26 08:59:34 +02:00
|
|
|
-mwindows
|
|
|
|
|
2017-11-20 07:46:46 +01:00
|
|
|
GTK_INCLUDES= `pkg-config --cflags gtk+-3.0`
|
|
|
|
GTK_LIBS= `pkg-config --libs gtk+-3.0`
|
|
|
|
|
2017-09-26 08:59:34 +02:00
|
|
|
LINUX_INCLUDES= \
|
2018-03-16 16:49:25 +01:00
|
|
|
$(GTK_INCLUDES)
|
2017-09-26 08:59:34 +02:00
|
|
|
|
2017-11-08 15:08:12 +01:00
|
|
|
LINUX_LIBS= \
|
2017-11-20 07:46:46 +01:00
|
|
|
$(GTK_LIBS) \
|
2018-02-26 12:36:28 +01:00
|
|
|
-L$(3RD_PARTY)/wren-0.1.0/lib \
|
2018-03-16 11:43:54 +01:00
|
|
|
-L$(3RD_PARTY)/sdl-gpu/build/linux \
|
2018-03-16 16:49:25 +01:00
|
|
|
-L$(3RD_PARTY)/lua-5.3.1/src \
|
2018-08-03 00:17:40 +02:00
|
|
|
-L$(3RD_PARTY)/squirrel3.1/lib \
|
2018-03-16 16:49:25 +01:00
|
|
|
-L$(3RD_PARTY)/SDL2-2.0.7/build/.libs
|
2017-11-08 15:08:12 +01:00
|
|
|
|
2017-09-26 08:59:34 +02:00
|
|
|
LINUX64_LIBS= \
|
2018-02-06 12:44:33 +01:00
|
|
|
$(GTK_LIBS) \
|
2018-01-10 14:05:49 +01:00
|
|
|
-L$(PRE_BUILT)/linux64
|
2017-09-26 08:59:34 +02:00
|
|
|
|
|
|
|
LINUX32_LIBS= \
|
2018-02-06 12:44:33 +01:00
|
|
|
$(GTK_LIBS) \
|
2018-01-10 14:05:49 +01:00
|
|
|
-L$(PRE_BUILT)/linux32
|
2017-09-26 08:59:34 +02:00
|
|
|
|
|
|
|
LINUX_ARM_LIBS= \
|
2018-01-10 14:05:49 +01:00
|
|
|
-L$(PRE_BUILT)/arm
|
2017-09-26 08:59:34 +02:00
|
|
|
|
2017-11-11 20:52:12 +01:00
|
|
|
LINUX_LINKER_LTO_FLAGS= \
|
|
|
|
-lSDL2 \
|
2018-02-22 18:10:19 +01:00
|
|
|
-lsdlgpu \
|
2017-11-11 20:52:12 +01:00
|
|
|
-llua \
|
2018-02-05 14:52:55 +01:00
|
|
|
-lwren \
|
2018-08-03 00:17:40 +02:00
|
|
|
-lsquirrel -lsqstdlib -lstdc++ \
|
2017-11-11 20:52:12 +01:00
|
|
|
-lgif \
|
|
|
|
-ldl \
|
|
|
|
-lm \
|
|
|
|
-lpthread \
|
|
|
|
-lrt \
|
2018-02-22 18:10:19 +01:00
|
|
|
-lz \
|
|
|
|
-lGL
|
2017-11-11 20:52:12 +01:00
|
|
|
|
2017-09-26 08:59:34 +02:00
|
|
|
LINUX_LINKER_FLAGS= \
|
2018-03-16 11:43:54 +01:00
|
|
|
-llua \
|
2018-02-05 14:52:55 +01:00
|
|
|
-lwren \
|
2018-08-03 00:17:40 +02:00
|
|
|
-lsquirrel -lsqstdlib -lstdc++ \
|
2017-09-26 08:59:34 +02:00
|
|
|
-ldl \
|
|
|
|
-lm \
|
|
|
|
-lpthread \
|
|
|
|
-lrt \
|
2018-02-26 12:36:28 +01:00
|
|
|
-lz \
|
|
|
|
-lsdlgpu \
|
2018-03-16 16:49:25 +01:00
|
|
|
-lGL \
|
2018-03-24 09:57:17 +01:00
|
|
|
-l:libSDL2.a
|
2018-03-16 16:49:25 +01:00
|
|
|
|
2017-09-26 08:59:34 +02:00
|
|
|
|
2017-11-21 18:34:01 +01:00
|
|
|
MINGW_OUTPUT=$(BIN_NAME).exe
|
2017-09-26 08:59:34 +02:00
|
|
|
|
|
|
|
EMS_CC=emcc
|
|
|
|
EMS_OPT= \
|
|
|
|
-Wno-typedef-redefinition \
|
|
|
|
-s USE_SDL=2 \
|
|
|
|
-s TOTAL_MEMORY=67108864 \
|
|
|
|
--llvm-lto 1 \
|
|
|
|
--memory-init-file 0 \
|
2018-01-10 14:05:49 +01:00
|
|
|
--pre-js build/html/prejs.js \
|
2017-12-25 10:24:16 +01:00
|
|
|
-s 'EXTRA_EXPORTED_RUNTIME_METHODS=["writeArrayToMemory"]'
|
2017-09-26 08:59:34 +02:00
|
|
|
|
|
|
|
EMS_LINKER_FLAGS= \
|
2018-01-10 14:05:49 +01:00
|
|
|
-L$(PRE_BUILT)/emscripten \
|
2017-09-26 08:59:34 +02:00
|
|
|
-llua \
|
2018-02-05 14:52:55 +01:00
|
|
|
-lwren \
|
2018-08-03 00:17:40 +02:00
|
|
|
-lsquirrel \
|
2017-09-26 08:59:34 +02:00
|
|
|
-lgif \
|
2018-02-22 13:32:06 +01:00
|
|
|
-lz \
|
|
|
|
-lsdlgpu
|
2017-09-26 08:59:34 +02:00
|
|
|
|
|
|
|
MACOSX_OPT= \
|
|
|
|
-mmacosx-version-min=10.6 \
|
|
|
|
-Wno-typedef-redefinition \
|
2018-02-16 13:43:30 +01:00
|
|
|
-D_THREAD_SAFE
|
2017-09-26 08:59:34 +02:00
|
|
|
|
|
|
|
MACOSX_LIBS= \
|
2018-01-10 14:05:49 +01:00
|
|
|
-L$(PRE_BUILT)/macos \
|
2017-09-26 08:59:34 +02:00
|
|
|
-L/usr/local/lib \
|
2018-02-05 14:52:55 +01:00
|
|
|
-lSDL2 -lm -liconv -lobjc -llua -lwren -lz -lgif \
|
2018-02-22 18:50:05 +01:00
|
|
|
-lsdlgpu \
|
2017-09-26 08:59:34 +02:00
|
|
|
-Wl,-framework,CoreAudio \
|
|
|
|
-Wl,-framework,AudioToolbox \
|
|
|
|
-Wl,-framework,ForceFeedback \
|
|
|
|
-Wl,-framework,CoreVideo \
|
|
|
|
-Wl,-framework,Cocoa \
|
|
|
|
-Wl,-framework,Carbon \
|
2018-02-22 18:50:05 +01:00
|
|
|
-Wl,-framework,IOKit \
|
|
|
|
-Wl,-framework,OpenGL
|
2017-09-26 08:59:34 +02:00
|
|
|
|
|
|
|
SOURCES=\
|
|
|
|
src/studio.c \
|
|
|
|
src/console.c \
|
|
|
|
src/run.c \
|
|
|
|
src/ext/file_dialog.c \
|
|
|
|
src/ext/md5.c \
|
|
|
|
src/ext/gif.c \
|
2018-01-10 15:36:49 +01:00
|
|
|
$(SDL_NET_LIB)/SDLnet.c \
|
|
|
|
$(SDL_NET_LIB)/SDLnetTCP.c \
|
|
|
|
$(SDL_NET_LIB)/SDLnetselect.c \
|
2017-09-26 08:59:34 +02:00
|
|
|
src/fs.c \
|
|
|
|
src/tools.c \
|
|
|
|
src/start.c \
|
|
|
|
src/sprite.c \
|
|
|
|
src/map.c \
|
|
|
|
src/sfx.c \
|
|
|
|
src/music.c \
|
|
|
|
src/history.c \
|
|
|
|
src/world.c \
|
|
|
|
src/config.c \
|
|
|
|
src/code.c \
|
|
|
|
src/dialog.c \
|
|
|
|
src/menu.c \
|
|
|
|
src/net.c \
|
2018-02-26 07:43:59 +01:00
|
|
|
src/surf.c
|
|
|
|
|
|
|
|
SYSTEM=\
|
2018-02-14 14:53:32 +01:00
|
|
|
src/system.c
|
2017-09-26 08:59:34 +02:00
|
|
|
|
|
|
|
SOURCES_EXT= \
|
|
|
|
src/html.c
|
|
|
|
|
2018-01-10 10:30:19 +01:00
|
|
|
LPEG_SRC= $(3RD_PARTY)/lpeg-1.0.1/*.c
|
|
|
|
GIF_SRC= $(3RD_PARTY)/giflib-5.1.4/lib/*.c
|
2018-01-10 15:11:22 +01:00
|
|
|
BLIP_SRC= $(BLIPBUF_LIB)/blip_buf.c
|
2017-11-08 15:08:12 +01:00
|
|
|
|
2017-09-26 08:59:34 +02:00
|
|
|
DEMO_ASSETS= \
|
|
|
|
bin/assets/fire.tic.dat \
|
|
|
|
bin/assets/p3d.tic.dat \
|
|
|
|
bin/assets/palette.tic.dat \
|
|
|
|
bin/assets/quest.tic.dat \
|
|
|
|
bin/assets/sfx.tic.dat \
|
|
|
|
bin/assets/music.tic.dat \
|
|
|
|
bin/assets/font.tic.dat \
|
|
|
|
bin/assets/tetris.tic.dat \
|
|
|
|
bin/assets/jsdemo.tic.dat \
|
|
|
|
bin/assets/luademo.tic.dat \
|
|
|
|
bin/assets/moondemo.tic.dat \
|
2018-05-16 05:33:57 +02:00
|
|
|
bin/assets/fenneldemo.tic.dat \
|
2018-02-05 14:52:55 +01:00
|
|
|
bin/assets/wrendemo.tic.dat \
|
2018-08-04 14:32:08 +02:00
|
|
|
bin/assets/squirreldemo.tic.dat \
|
2017-11-20 10:09:21 +01:00
|
|
|
bin/assets/benchmark.tic.dat \
|
2017-09-26 08:59:34 +02:00
|
|
|
bin/assets/config.tic.dat
|
|
|
|
|
|
|
|
all: run
|
|
|
|
|
2018-01-10 10:30:19 +01:00
|
|
|
TIC80_H = include/tic80_types.h include/tic80.h include/tic80_config.h src/tic.h src/ticapi.h src/machine.h
|
2017-09-26 08:59:34 +02:00
|
|
|
|
|
|
|
TIC_H= src/*.h \
|
|
|
|
src/ext/*.h
|
|
|
|
|
2017-12-31 08:00:12 +01:00
|
|
|
bin/studio.o: src/studio.c src/keycodes.c $(TIC80_H) $(TIC_H)
|
2017-09-26 08:59:34 +02:00
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/console.o: src/console.c $(TIC80_H) $(TIC_H) $(DEMO_ASSETS)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/run.o: src/run.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/file_dialog.o: src/ext/file_dialog.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/md5.o: src/ext/md5.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/gif.o: src/ext/gif.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
2018-01-10 15:36:49 +01:00
|
|
|
bin/SDLnet.o: $(SDL_NET_LIB)/SDLnet.c $(TIC80_H) $(TIC_H)
|
2017-09-26 08:59:34 +02:00
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
2018-01-10 15:36:49 +01:00
|
|
|
bin/SDLnetTCP.o: $(SDL_NET_LIB)/SDLnetTCP.c $(TIC80_H) $(TIC_H)
|
2017-09-26 08:59:34 +02:00
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
2018-01-10 15:36:49 +01:00
|
|
|
bin/SDLnetselect.o: $(SDL_NET_LIB)/SDLnetselect.c $(TIC80_H) $(TIC_H)
|
2017-09-26 08:59:34 +02:00
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/fs.o: src/fs.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/tools.o: src/tools.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/start.o: src/start.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/sprite.o: src/sprite.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/map.o: src/map.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/sfx.o: src/sfx.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/music.o: src/music.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/history.o: src/history.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/world.o: src/world.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/config.o: src/config.c $(TIC80_H) $(TIC_H) $(DEMO_ASSETS)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/code.o: src/code.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/net.o: src/net.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/dialog.o: src/dialog.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/menu.o: src/menu.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/surf.o: src/surf.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
2018-02-26 11:56:54 +01:00
|
|
|
bin/system.o: src/system.c src/keycodes.c $(TIC80_H) $(TIC_H)
|
2018-01-24 10:20:05 +01:00
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
2018-02-26 07:43:59 +01:00
|
|
|
bin/chip.o: src/system/chip.c src/keycodes.c $(TIC80_H) $(TIC_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
2018-02-07 16:21:24 +01:00
|
|
|
SDL_NET = \
|
|
|
|
bin/SDLnet.o \
|
|
|
|
bin/SDLnetTCP.o \
|
|
|
|
bin/SDLnetselect.o \
|
|
|
|
bin/net.o
|
|
|
|
|
2018-02-08 12:26:17 +01:00
|
|
|
FILE_DIALOG = \
|
|
|
|
bin/file_dialog.o
|
|
|
|
|
2017-09-26 08:59:34 +02:00
|
|
|
TIC_O=\
|
|
|
|
bin/studio.o \
|
|
|
|
bin/console.o \
|
|
|
|
bin/run.o \
|
|
|
|
bin/md5.o \
|
|
|
|
bin/gif.o \
|
|
|
|
bin/fs.o \
|
|
|
|
bin/tools.o \
|
|
|
|
bin/start.o \
|
|
|
|
bin/sprite.o \
|
|
|
|
bin/map.o \
|
|
|
|
bin/sfx.o \
|
|
|
|
bin/music.o \
|
|
|
|
bin/history.o \
|
|
|
|
bin/world.o \
|
|
|
|
bin/config.o \
|
|
|
|
bin/code.o \
|
|
|
|
bin/dialog.o \
|
|
|
|
bin/menu.o \
|
2018-02-07 16:21:24 +01:00
|
|
|
bin/surf.o
|
2017-09-26 08:59:34 +02:00
|
|
|
|
|
|
|
bin/tic80.o: src/tic80.c $(TIC80_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -DTIC80_SHARED -c -o $@
|
|
|
|
|
|
|
|
bin/tic.o: src/tic.c $(TIC80_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
2018-01-10 15:11:22 +01:00
|
|
|
bin/blip_buf.o: $(BLIP_SRC)
|
2017-09-26 08:59:34 +02:00
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/jsapi.o: src/jsapi.c $(TIC80_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
|
|
|
bin/luaapi.o: src/luaapi.c $(TIC80_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
2018-08-03 00:17:40 +02:00
|
|
|
bin/squirrelapi.o: src/squirrelapi.c $(TIC80_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
2018-02-05 14:52:55 +01:00
|
|
|
bin/wrenapi.o: src/wrenapi.c $(TIC80_H)
|
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
2018-01-10 12:45:53 +01:00
|
|
|
bin/duktape.o: $(DUKTAPE_LIB)/duktape.c $(TIC80_H)
|
2017-09-26 08:59:34 +02:00
|
|
|
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
|
|
|
|
|
2018-08-03 00:17:40 +02:00
|
|
|
TIC80_SRC = src/tic80.c src/tic.c $(BLIP_SRC) src/jsapi.c src/luaapi.c src/wrenapi.c src/squirrelapi.c $(DUKTAPE_LIB)/duktape.c
|
|
|
|
TIC80_O = bin/squirrelapi.o bin/tic80.o bin/tic.o bin/tools.o bin/blip_buf.o bin/jsapi.o bin/luaapi.o bin/wrenapi.o bin/duktape.o bin/gif.o
|
2017-09-26 08:59:34 +02:00
|
|
|
TIC80_A = bin/libtic80.a
|
|
|
|
TIC80_DLL = bin/tic80.dll
|
|
|
|
|
2018-02-07 16:21:24 +01:00
|
|
|
STUDIO_A = bin/libstudio.a
|
|
|
|
STUDIO_DLL = bin/studio.dll
|
|
|
|
|
2017-09-26 08:59:34 +02:00
|
|
|
$(TIC80_DLL): $(TIC80_O)
|
2018-02-05 14:52:55 +01:00
|
|
|
$(CC) $(OPT) -shared $(TIC80_O) -L$(PRE_BUILT)/mingw -llua -lwren -lgif -Wl,--out-implib,$(TIC80_A) -o $@
|
2017-09-26 08:59:34 +02:00
|
|
|
|
2018-02-07 16:21:24 +01:00
|
|
|
$(STUDIO_DLL): $(DEMO_ASSETS) $(TIC80_DLL) $(TIC_O) bin/html.o
|
|
|
|
$(CC) $(TIC_O) bin/html.o $(TIC80_A) $(OPT) -shared $(INCLUDES) -L$(PRE_BUILT)/mingw -llua -lz -lgif -Wl,--out-implib,$(STUDIO_A) -o $@
|
|
|
|
|
2017-09-26 08:59:34 +02:00
|
|
|
emscripten:
|
2018-07-11 12:47:33 +02:00
|
|
|
$(EMS_CC) $(SOURCES) $(SYSTEM) $(TIC80_SRC) $(OPT) $(INCLUDES) $(EMS_OPT) -s WASM=0 $(EMS_LINKER_FLAGS) -o build/html/tic.js
|
2017-09-26 08:59:34 +02:00
|
|
|
|
2018-01-22 14:35:19 +01:00
|
|
|
wasm:
|
2018-02-26 07:43:59 +01:00
|
|
|
$(EMS_CC) $(SOURCES) $(SYSTEM) $(TIC80_SRC) $(OPT) $(INCLUDES) $(EMS_OPT) -s WASM=1 $(EMS_LINKER_FLAGS) -o build/html/tic.js
|
2018-01-22 14:35:19 +01:00
|
|
|
|
2018-02-14 13:16:33 +01:00
|
|
|
mingw: $(STUDIO_DLL) $(SDL_NET) $(FILE_DIALOG) bin/system.o bin/res.o
|
|
|
|
$(CC) bin/system.o bin/res.o $(STUDIO_A) $(SDL_NET) $(FILE_DIALOG) $(OPT) $(INCLUDES) $(MINGW_LINKER_FLAGS) -o $(MINGW_OUTPUT)
|
2017-09-26 08:59:34 +02:00
|
|
|
|
2017-11-09 18:34:03 +01:00
|
|
|
mingw-pro:
|
2017-11-11 20:52:12 +01:00
|
|
|
$(eval OPT += $(OPT_PRO))
|
2017-11-09 18:34:03 +01:00
|
|
|
make mingw OPT="$(OPT)"
|
|
|
|
|
|
|
|
run: mingw-pro
|
2017-09-26 08:59:34 +02:00
|
|
|
$(MINGW_OUTPUT)
|
|
|
|
|
2017-11-09 18:34:03 +01:00
|
|
|
linux64-lto:
|
2018-02-26 07:43:59 +01:00
|
|
|
$(CC) $(GTK_INCLUDES) $(SOURCES) $(SYSTEM) $(TIC80_SRC) $(SOURCES_EXT) $(OPT) $(INCLUDES) $(LINUX64_LIBS) $(LINUX_LINKER_LTO_FLAGS) -flto -o $(BIN_NAME)
|
2017-11-11 20:52:12 +01:00
|
|
|
|
|
|
|
linux64-lto-pro:
|
|
|
|
$(eval OPT += $(OPT_PRO))
|
|
|
|
make linux64-lto OPT="$(OPT)"
|
2017-09-26 08:59:34 +02:00
|
|
|
|
2017-11-09 18:34:03 +01:00
|
|
|
linux32-lto:
|
2018-02-26 07:43:59 +01:00
|
|
|
$(CC) $(GTK_INCLUDES) $(SOURCES) $(SYSTEM) $(TIC80_SRC) $(SOURCES_EXT) $(OPT) $(INCLUDES) $(LINUX32_LIBS) $(LINUX_LINKER_LTO_FLAGS) -flto -o $(BIN_NAME)
|
2017-11-11 20:52:12 +01:00
|
|
|
|
|
|
|
linux32-lto-pro:
|
|
|
|
$(eval OPT += $(OPT_PRO))
|
|
|
|
make linux32-lto OPT="$(OPT)"
|
2017-09-26 08:59:34 +02:00
|
|
|
|
2017-11-20 07:14:37 +01:00
|
|
|
chip-lto:
|
2018-02-26 07:43:59 +01:00
|
|
|
$(CC) $(LINUX_INCLUDES) $(GTK_INCLUDES) $(SOURCES) src/system/chip.c $(TIC80_SRC) $(SOURCES_EXT) $(OPT) -D__CHIP__ $(INCLUDES) $(LINUX_ARM_LIBS) $(GTK_LIBS) $(LINUX_LINKER_LTO_FLAGS) -flto -o $(BIN_NAME)
|
2017-11-11 20:52:12 +01:00
|
|
|
|
2017-11-20 07:14:37 +01:00
|
|
|
chip-lto-pro:
|
2017-11-11 20:52:12 +01:00
|
|
|
$(eval OPT += $(OPT_PRO))
|
2017-11-20 07:14:37 +01:00
|
|
|
make chip-lto OPT="$(OPT)"
|
2017-09-26 08:59:34 +02:00
|
|
|
|
2018-02-27 08:14:17 +01:00
|
|
|
WREN_A=$(3RD_PARTY)/wren-0.1.0/lib/libwren.a
|
|
|
|
SDLGPU_A=$(3RD_PARTY)/sdl-gpu/build/linux/libsdlgpu.a
|
2018-03-16 11:43:54 +01:00
|
|
|
LUA_A=$(3RD_PARTY)/lua-5.3.1/src/liblua.a
|
2018-03-16 16:49:25 +01:00
|
|
|
SDL2_A=$(3RD_PARTY)/SDL2-2.0.7/build/.libs/libSDL2.a
|
2018-08-03 00:17:40 +02:00
|
|
|
SQUIRREL_A=$(3RD_PARTY)/squirrel3.1/lib/libsquirrel.a
|
2018-02-27 08:14:17 +01:00
|
|
|
|
|
|
|
$(WREN_A):
|
|
|
|
make static -C $(3RD_PARTY)/wren-0.1.0/
|
|
|
|
|
|
|
|
$(SDLGPU_A):
|
|
|
|
make -C $(3RD_PARTY)/sdl-gpu/build/linux/
|
|
|
|
|
2018-03-16 11:43:54 +01:00
|
|
|
$(LUA_A):
|
|
|
|
make linux -C $(3RD_PARTY)/lua-5.3.1/
|
|
|
|
|
2018-03-16 16:49:25 +01:00
|
|
|
$(SDL2_A):
|
2018-03-30 08:28:54 +02:00
|
|
|
cd $(3RD_PARTY)/SDL2-2.0.7/ && ./configure --enable-sndio=no && make && cd ../..
|
2018-03-16 16:49:25 +01:00
|
|
|
|
2018-08-03 00:17:40 +02:00
|
|
|
$(SQUIRREL_A):
|
|
|
|
cd $(3RD_PARTY)/squirrel3.1/ && make && cd ../..
|
|
|
|
|
|
|
|
linux: $(WREN_A) $(SDLGPU_A) $(LUA_A) $(SDL2_A) $(SQUIRREL_A)
|
2018-02-26 07:43:59 +01:00
|
|
|
$(CC) $(LINUX_INCLUDES) $(SOURCES) $(SYSTEM) $(LPEG_SRC) $(GIF_SRC) $(SOURCES_EXT) $(TIC80_SRC) $(OPT) $(INCLUDES) $(LINUX_LIBS) $(LINUX_LINKER_FLAGS) -o $(BIN_NAME)
|
2017-11-08 15:08:12 +01:00
|
|
|
|
2017-11-11 20:52:12 +01:00
|
|
|
linux-pro:
|
|
|
|
$(eval OPT += $(OPT_PRO))
|
|
|
|
make linux OPT="$(OPT)"
|
|
|
|
|
2017-09-26 08:59:34 +02:00
|
|
|
macosx:
|
2018-02-26 07:43:59 +01:00
|
|
|
$(CC) $(SOURCES) $(SYSTEM) $(TIC80_SRC) $(SOURCES_EXT) src/ext/file_dialog.m $(OPT) $(MACOSX_OPT) $(INCLUDES) $(MACOSX_LIBS) -o $(BIN_NAME)
|
2017-09-26 08:59:34 +02:00
|
|
|
|
2017-11-11 20:52:12 +01:00
|
|
|
macosx-pro:
|
|
|
|
$(eval OPT += $(OPT_PRO))
|
|
|
|
make macosx OPT="$(OPT)"
|
|
|
|
|
2018-01-10 14:05:49 +01:00
|
|
|
bin/res.o: build/mingw/res.rc build/mingw/icon.ico
|
2017-09-26 08:59:34 +02:00
|
|
|
windres $< $@
|
|
|
|
|
|
|
|
BIN2TXT= tools/bin2txt/bin2txt
|
|
|
|
|
|
|
|
bin/html.o: src/html.c build/html/index.html build/html/tic.js
|
|
|
|
$(BIN2TXT) build/html/index.html bin/assets/index.html.dat -z
|
|
|
|
$(BIN2TXT) build/html/tic.js bin/assets/tic.js.dat -z
|
|
|
|
$(CC) -c src/html.c $(OPT) $(INCLUDES) -o $@
|
|
|
|
|
|
|
|
bin/assets/config.tic.dat: config.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
|
|
|
bin/assets/fire.tic.dat: demos/fire.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
|
|
|
bin/assets/p3d.tic.dat: demos/p3d.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
|
|
|
bin/assets/palette.tic.dat: demos/palette.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
|
|
|
bin/assets/quest.tic.dat: demos/quest.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
|
|
|
bin/assets/sfx.tic.dat: demos/sfx.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
|
|
|
bin/assets/font.tic.dat: demos/font.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
|
|
|
bin/assets/music.tic.dat: demos/music.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
|
|
|
bin/assets/tetris.tic.dat: demos/tetris.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
|
|
|
bin/assets/jsdemo.tic.dat: demos/jsdemo.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
|
|
|
bin/assets/luademo.tic.dat: demos/luademo.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
2018-02-05 14:52:55 +01:00
|
|
|
bin/assets/wrendemo.tic.dat: demos/wrendemo.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
2017-09-26 08:59:34 +02:00
|
|
|
bin/assets/moondemo.tic.dat: demos/moondemo.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
2018-05-16 05:33:57 +02:00
|
|
|
bin/assets/fenneldemo.tic.dat: demos/fenneldemo.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
2018-08-04 14:32:08 +02:00
|
|
|
bin/assets/squirreldemo.tic.dat: demos/squirreldemo.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
2017-11-20 10:09:21 +01:00
|
|
|
bin/assets/benchmark.tic.dat: demos/benchmark.tic
|
|
|
|
$(BIN2TXT) $< $@ -z
|
|
|
|
|
2017-09-26 08:59:34 +02:00
|
|
|
clean: $(TIC_O) $(TIC80_O)
|
2017-11-09 18:34:03 +01:00
|
|
|
del bin\*.o
|