diff options
author | kdx <kikoodx@paranoici.org> | 2023-03-26 17:49:03 +0200 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2023-03-26 17:49:40 +0200 |
commit | 49fe8dd96d673c4ff63590c169815c4340bc67b0 (patch) | |
tree | c3a8cc1421296a22749642d08827c98391ad6ee8 /Makefile | |
download | 006-49fe8dd96d673c4ff63590c169815c4340bc67b0.tar.gz |
initial commit
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..7d80fd7 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +CC := gcc +LD := $(CC) +WINCC := x86_64-w64-mingw32-gcc +CFLAGS := -Os -std=c2x -Wall -Wextra -Imap -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 |