blob: f069ef2a3f8b4a0f306fa6a5a842dcf80d2ea8ee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
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/new32v2.c \
src/new32v3.c \
src/mastur.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
|