-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (38 loc) · 897 Bytes
/
Makefile
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
46
47
48
AS = nasm
ASFLAGS = -f macho64
CFLAGS = -Wall -Wextra
GOBUILD = go build
COLLEEN = Colleen
GRACE = Grace
SULLY = Sully
COLLEEN_O = Colleen.o
GRACE_O = Grace.o
SULLY_O = Sully.o
OBJS = $(COLLEEN_O) $(GRACE_O) $(SULLY_O)
EXECS = $(COLLEEN) $(GRACE) $(SULLY)
# asm
ASM_OBJ = $(addprefix $(ASM_DIR), $(OBJS))
ASM_EXEC = $(addprefix $(ASM_DIR), $(EXECS))
ASM_DIR = asm/
# c
C_EXEC = $(addprefix $(C_DIR), $(EXECS))
C_DIR = c/
# golang
GO_EXEC = $(addprefix $(GO_DIR), $(EXECS))
GO_DIR = golang/
all: $(C_DIR) $(ASM_DIR) $(GO_DIR)
.PHONY: $(C_DIR)
$(C_DIR): $(C_EXEC)
.PHONY: $(ASM_DIR)
$(ASM_DIR): $(ASM_OBJ) $(ASM_EXEC)
.PHONY: $(GO_DIR)
$(GO_DIR): $(GO_EXEC)
%: %.go
$(GOBUILD) -o $@ $<
clean:
$(RM) $(ASM_OBJ)
fclean: clean
$(RM) $(C_EXEC) $(ASM_EXEC) $(GO_EXEC)
find . -type f -name 'Sully_[0-4].*' -exec rm {} ';'
find . -type f -name '*Grace_kid.*' -exec rm {} ';'
re: fclean all