diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..74b3a51 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +CC := gcc +LD := $(CC) +WINCC := x86_64-w64-mingw32-gcc +CFLAGS := -g -Os -std=c2x -Wall -Wextra -DLZR_DISABLE_DEVMODE= +LDFLAGS := -lm -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2_gfx +NAME := jambase +SRC := $(wildcard src/*.c) +OBJ := $(patsubst src/%.c,obj/%.o,$(SRC)) +DEP := $(patsubst %.o,%.d,$(OBJ)) + +all: embed + @make --no-print-directory $(NAME) + +$(NAME): $(OBJ) + $(LD) -o $(NAME) -MMD $(OBJ) $(LDFLAGS) + +obj/%.o: src/%.c + @mkdir -p obj + $(CC) $(CFLAGS) -c -o $@ $< + +embed: + tmj2c map/*.tmj >map/maps.h + +run: re + ./$(NAME) + +clean: + rm -rf $(NAME) $(NAME).exe obj/ map/maps.h + +re: + @make --no-print-directory clean + @make --no-print-directory all + +windows: embed + $(WINCC) $(CFLAGS) -o $(NAME).exe $(SRC) $(LDFLAGS) + +.PHONY: all embed run clean re windows |