diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2016-03-30 08:25:04 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2016-03-30 08:25:04 +0200 |
commit | 4bf61f911194bb0b40d302df8d7dfff2fda19892 (patch) | |
tree | 1d8619d4cff047bf2a72aa6a1bcfe4e683f43226 /Makefile |
Initial commit.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..906910c --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +CC = gcc +CFLAGS += -g -Wall +CPPFLAGS += -MMD +LDFLAGS += -lm -lSDL2 -lSDL2_image + +PP_BOLD := $(shell tput bold) +PP_RESET := $(shell tput sgr0) +PP_CC := $(PP_BOLD)$(shell tput setf 6)CC$(PP_RESET) +PP_LD := $(PP_BOLD)$(shell tput setf 2)LD$(PP_RESET) +PP_RM := $(PP_BOLD)$(shell tput setf 4)RM$(PP_RESET) + +SRC := src/main.c src/physics.c src/renderer.c src/ui.c +OBJ := $(SRC:src/%.c=obj/%.o) +OUT := cem + +all: $(OUT) + +-include $(OBJ:.o=.d) + +obj/%.o : src/%.c + @echo "$(PP_CC) src/$*.c" + @mkdir -p $(@D) + @$(CC) $(CFLAGS) $(CPPFLAGS) -c src/$*.c -o obj/$*.o + +$(OUT): $(OBJ) + @echo "$(PP_LD) $(OUT)" + @$(CC) $(OBJ) -o $(OUT) $(LDFLAGS) + +clean: + @echo "${PP_RM} obj" + @rm -rf obj + @echo "${PP_RM} ${OUT}" + @rm -rf ${OUT} + +.PHONY: clean + |