diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2018-09-25 17:32:02 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2018-09-25 17:36:02 +0200 |
commit | 0e11a91fce4d7e1a4cdcd91f8bd042fa89d6b9cc (patch) | |
tree | 4a43b2ad467416b494cc1af3485abf82cc90da4a /Makefile | |
parent | ccdaeea51ede15f6c882660390e9b9456aa1256d (diff) |
The code.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f3400a6 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +CC ?= gcc +CFLAGS += -O3 -Wall +CPPFLAGS += -MMD +LDFLAGS += -lm + +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/bigtab.c \ + src/main.c \ + src/new.c \ + src/new32.c \ + src/null.c \ + src/ref.c + +OBJ := $(SRC:src/%.c=obj/%.o) +OUT := division-golf + +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 + |