12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- CC = cc
- SRCCOMMON = src/global-state.c src/data-structure.c src/hashing.c src/file-loading.c 3rdparty/stringutils/src/stringutils.c 3rdparty/vec/src/vec.c
- SRCGUI = src/picunic-gui.c src/gui-loop.c
- SRCCLI =
- NAMEGUI = picunic-gui
- NAMECLI = picunic-cli
- PREFIX = /usr/local
- INCLUDEPATHS = -I./include -I./3rdparty -I./3rdparty/raylib/src -I./3rdparty/raygui/src -I./3rdparty/stringutils/include -I./3rdparty/vec/src
- CFLAGSGUI = -O2 -g -ggdb3 -Wall -Wextra -Wpedantic --std=c99 -D_DEFAULT_SOURCE ${INCLUDEPATHS}
- ifeq ($(OS),Windows_NT)
- LDFLAGSGUI = -L3rdparty/raylib/src -lraylib -lm -lpthread -ldl -lwinmm -lgdi32 -ldxguid -lregex -ltre -lintl -liconv -static
- else
- LDFLAGSGUI = -L3rdparty/raylib -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
- endif
- CFLAGSCLI =
- LDFLAGSCLI =
- all: clean ${NAMEGUI}
- raylib:
- git apply --directory=3rdparty/raylib patches/0001-config-changes.patch
- $(MAKE) -C ./3rdparty/raylib/src
- git apply -R --directory=3rdparty/raylib patches/0001-config-changes.patch
- optionsgui:
- @echo ""
- @echo "========================================="
- @echo "Opts:"
- @echo "CFLAGS = ${CFLAGSGUI}"
- @echo "LDFLAGS = ${LDFLAGSGUI}"
- @echo "CC = ${CC}"
- @echo "========================================="
- @echo ""
- optionscli:
- @echo ""
- @echo "========================================="
- @echo "Opts:"
- @echo "CFLAGS = ${CFLAGSCLI}"
- @echo "LDFLAGS = ${LDFLAGSCLI}"
- @echo "CC = ${CC}"
- @echo "========================================="
- @echo ""
- ${NAMEGUI}: raylib optionsgui
- mkdir -p bin
- ${CC} ${SRCGUI} ${SRCCOMMON} ${CFLAGSGUI} ${LDFLAGSGUI} -o bin/${NAMEGUI}
- # bin/${NAMEGUI}
- ${NAMECLI}: optionscli
- mkdir -p bin
- ${CC} {SRCCOMMON} ${SRCCLI} ${CFLAGSCLI} ${LDFLAGSCLI} -o bin/${NAMECLI}
- clean:
- rm -rf bin
- rm -rf obj
- install:
- cp -i bin/${NAMEGUI} ${PREFIX}/bin/${NAMEGUI}
- uninstall:
- rm -i ${PREFIX}/bin/${NAMEGUI}
- .PHONY: all install uninstall clean
|