makefile changes for Linux
This commit is contained in:
parent
6034c8f922
commit
440e40a9a5
42
Makefile
42
Makefile
|
@ -1,6 +1,7 @@
|
||||||
CC=gcc
|
CC=gcc
|
||||||
OPT=-O3 -Wall -std=c99
|
OPT=-O3 -Wall -std=c99
|
||||||
OPT_ARM=-D__ARM_LINUX__
|
OPT_ARM=-D__ARM_LINUX__
|
||||||
|
OPT_PRO=-DTIC80_PRO
|
||||||
|
|
||||||
RM= rm -f
|
RM= rm -f
|
||||||
|
|
||||||
|
@ -31,7 +32,7 @@ LINUX_LIBS= \
|
||||||
|
|
||||||
LINUX64_LIBS= \
|
LINUX64_LIBS= \
|
||||||
$(LINUX_LIBS) \
|
$(LINUX_LIBS) \
|
||||||
-Llib/linux
|
-Llib/linux64
|
||||||
|
|
||||||
LINUX32_LIBS= \
|
LINUX32_LIBS= \
|
||||||
$(LINUX_LIBS) \
|
$(LINUX_LIBS) \
|
||||||
|
@ -40,6 +41,17 @@ LINUX32_LIBS= \
|
||||||
LINUX_ARM_LIBS= \
|
LINUX_ARM_LIBS= \
|
||||||
-Llib/arm
|
-Llib/arm
|
||||||
|
|
||||||
|
LINUX_LINKER_LTO_FLAGS= \
|
||||||
|
-D_GNU_SOURCE \
|
||||||
|
-lSDL2 \
|
||||||
|
-llua \
|
||||||
|
-lgif \
|
||||||
|
-ldl \
|
||||||
|
-lm \
|
||||||
|
-lpthread \
|
||||||
|
-lrt \
|
||||||
|
-lz
|
||||||
|
|
||||||
LINUX_LINKER_FLAGS= \
|
LINUX_LINKER_FLAGS= \
|
||||||
-D_GNU_SOURCE \
|
-D_GNU_SOURCE \
|
||||||
-lSDL2 \
|
-lSDL2 \
|
||||||
|
@ -275,27 +287,47 @@ mingw: $(DEMO_ASSETS) $(TIC80_DLL) $(TIC_O) bin/html.o bin/res.o
|
||||||
$(CC) $(TIC_O) bin/html.o bin/res.o $(TIC80_A) $(OPT) $(INCLUDES) $(MINGW_LINKER_FLAGS) -o $(MINGW_OUTPUT)
|
$(CC) $(TIC_O) bin/html.o bin/res.o $(TIC80_A) $(OPT) $(INCLUDES) $(MINGW_LINKER_FLAGS) -o $(MINGW_OUTPUT)
|
||||||
|
|
||||||
mingw-pro:
|
mingw-pro:
|
||||||
$(eval OPT += -DTIC80_PRO)
|
$(eval OPT += $(OPT_PRO))
|
||||||
make mingw OPT="$(OPT)"
|
make mingw OPT="$(OPT)"
|
||||||
|
|
||||||
run: mingw-pro
|
run: mingw-pro
|
||||||
$(MINGW_OUTPUT)
|
$(MINGW_OUTPUT)
|
||||||
|
|
||||||
linux64-lto:
|
linux64-lto:
|
||||||
$(CC) $(LINUX_INCLUDES) $(SOURCES) $(TIC80_SRC) $(SOURCES_EXT) $(OPT) $(INCLUDES) $(LINUX64_LIBS) $(LINUX_LINKER_FLAGS) -flto -o bin/tic
|
$(CC) $(LINUX_INCLUDES) $(SOURCES) $(TIC80_SRC) $(SOURCES_EXT) $(OPT) $(INCLUDES) $(LINUX64_LIBS) $(LINUX_LINKER_LTO_FLAGS) -flto -o bin/tic
|
||||||
|
|
||||||
|
linux64-lto-pro:
|
||||||
|
$(eval OPT += $(OPT_PRO))
|
||||||
|
make linux64-lto OPT="$(OPT)"
|
||||||
|
|
||||||
linux32-lto:
|
linux32-lto:
|
||||||
$(CC) $(LINUX_INCLUDES) $(SOURCES) $(TIC80_SRC) $(SOURCES_EXT) $(OPT) $(INCLUDES) $(LINUX32_LIBS) $(LINUX_LINKER_FLAGS) -flto -o bin/tic
|
$(CC) $(LINUX_INCLUDES) $(SOURCES) $(TIC80_SRC) $(SOURCES_EXT) $(OPT) $(INCLUDES) $(LINUX32_LIBS) $(LINUX_LINKER_LTO_FLAGS) -flto -o bin/tic
|
||||||
|
|
||||||
|
linux32-lto-pro:
|
||||||
|
$(eval OPT += $(OPT_PRO))
|
||||||
|
make linux32-lto OPT="$(OPT)"
|
||||||
|
|
||||||
arm-lto:
|
arm-lto:
|
||||||
$(CC) $(OPT_ARM) $(SOURCES) $(TIC80_SRC) $(OPT) $(INCLUDES) $(LINUX_ARM_LIBS) $(LINUX_LINKER_FLAGS) -flto -o bin/tic
|
$(CC) $(OPT_ARM) $(SOURCES) $(TIC80_SRC) $(OPT) $(INCLUDES) $(LINUX_ARM_LIBS) $(LINUX_LINKER_LTO_FLAGS) -flto -o bin/tic
|
||||||
|
|
||||||
|
arm-lto-pro:
|
||||||
|
$(eval OPT += $(OPT_PRO))
|
||||||
|
make arm-lto OPT="$(OPT)"
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
$(CC) $(LINUX_INCLUDES) $(SOURCES) $(LPEG_SRC) $(GIF_SRC) $(SOURCES_EXT) $(TIC80_SRC) $(OPT) $(INCLUDES) $(LINUX_LIBS) $(LINUX_LINKER_FLAGS) -o bin/tic
|
$(CC) $(LINUX_INCLUDES) $(SOURCES) $(LPEG_SRC) $(GIF_SRC) $(SOURCES_EXT) $(TIC80_SRC) $(OPT) $(INCLUDES) $(LINUX_LIBS) $(LINUX_LINKER_FLAGS) -o bin/tic
|
||||||
|
|
||||||
|
linux-pro:
|
||||||
|
$(eval OPT += $(OPT_PRO))
|
||||||
|
make linux OPT="$(OPT)"
|
||||||
|
|
||||||
macosx:
|
macosx:
|
||||||
$(CC) $(SOURCES) $(TIC80_SRC) $(SOURCES_EXT) src/ext/file_dialog.m $(OPT) $(MACOSX_OPT) $(INCLUDES) $(MACOSX_LIBS) -o bin/tic
|
$(CC) $(SOURCES) $(TIC80_SRC) $(SOURCES_EXT) src/ext/file_dialog.m $(OPT) $(MACOSX_OPT) $(INCLUDES) $(MACOSX_LIBS) -o bin/tic
|
||||||
|
|
||||||
|
macosx-pro:
|
||||||
|
$(eval OPT += $(OPT_PRO))
|
||||||
|
make macosx OPT="$(OPT)"
|
||||||
|
|
||||||
bin/res.o: lib/mingw/res.rc lib/mingw/icon.ico
|
bin/res.o: lib/mingw/res.rc lib/mingw/icon.ico
|
||||||
windres $< $@
|
windres $< $@
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue