diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-10-07 08:03:44 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-10-07 08:03:44 +0200 |
commit | 9e7d64d052eabcf40d85c3e903aaba44903a380a (patch) | |
tree | 0a3a2c7f53884bd035b54812a77d493be058f43c /Makefile |
Initial commit.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8ceb27a --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +CC ?= gcc +CFLAGS += -g3 -O3 -Wall +CPPFLAGS += -MMD +LDFLAGS += -lstdc++ -lm -lsfml-system -lsfml-window -lsfml-graphics + +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/game.cpp \ + src/interface.cpp \ + src/main.cpp \ + src/render.cpp \ + src/world.cpp + +OBJ := $(SRC:src/%.cpp=obj/%.o) +OUT := minitrem + +all: $(OUT) + +-include $(OBJ:.o=.d) + +obj/%.o : src/%.cpp + @echo "$(PP_CC) src/$*.cpp" + @mkdir -p $(@D) + @$(CC) $(CFLAGS) $(CPPFLAGS) -c src/$*.cpp -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 + |