-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
100 lines (75 loc) · 2.65 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/make
# Prefix directory where pit binary gets installed to.
PREFIX = /usr/local
# The toplevel directory of the source tree.
SRCDIR = ./src
# The directory into which object code files should be written.
OBJDIR = ./obj
# The directory into which executable file should be written.
BINDIR = ./bin
# C Compiler and options for use in building executable.
CC = gcc -g -Os -Wall
SRC = \
$(SRCDIR)/action.c \
$(SRCDIR)/args.c \
$(SRCDIR)/db.c \
$(SRCDIR)/help.c \
$(SRCDIR)/note.c \
$(SRCDIR)/format.c \
$(SRCDIR)/pit.c \
$(SRCDIR)/project.c \
$(SRCDIR)/table.c \
$(SRCDIR)/task.c \
$(SRCDIR)/util.c
OBJ = \
$(OBJDIR)/action.o \
$(OBJDIR)/args.o \
$(OBJDIR)/db.o \
$(OBJDIR)/help.o \
$(OBJDIR)/note.o \
$(OBJDIR)/format.o \
$(OBJDIR)/pit.o \
$(OBJDIR)/project.o \
$(OBJDIR)/table.o \
$(OBJDIR)/task.o \
$(OBJDIR)/util.o
APP = pit
all: $(OBJDIR) $(APP)
$(OBJDIR):
-mkdir $(OBJDIR)
-mkdir $(BINDIR)
$(APP): $(OBJ)
$(CC) -o $(BINDIR)/$(APP) $(OBJ)
$(OBJDIR)/action.o: $(SRCDIR)/action.c $(SRCDIR)/pit.h $(SRCDIR)/object.h $(SRCDIR)/table.h
$(CC) -o $(OBJDIR)/action.o -c $(SRCDIR)/action.c
$(OBJDIR)/args.o: $(SRCDIR)/args.c $(SRCDIR)/pit.h $(SRCDIR)/object.h $(SRCDIR)/table.h
$(CC) -o $(OBJDIR)/args.o -c $(SRCDIR)/args.c
$(OBJDIR)/db.o: $(SRCDIR)/db.c $(SRCDIR)/pit.h $(SRCDIR)/object.h $(SRCDIR)/table.h
$(CC) -o $(OBJDIR)/db.o -c $(SRCDIR)/db.c
$(OBJDIR)/help.o: $(SRCDIR)/help.c $(SRCDIR)/pit.h $(SRCDIR)/object.h $(SRCDIR)/table.h
$(CC) -o $(OBJDIR)/help.o -c $(SRCDIR)/help.c
$(OBJDIR)/note.o: $(SRCDIR)/note.c $(SRCDIR)/pit.h $(SRCDIR)/object.h $(SRCDIR)/table.h
$(CC) -o $(OBJDIR)/note.o -c $(SRCDIR)/note.c
$(OBJDIR)/format.o: $(SRCDIR)/format.c $(SRCDIR)/pit.h $(SRCDIR)/object.h $(SRCDIR)/table.h
$(CC) -o $(OBJDIR)/format.o -c $(SRCDIR)/format.c
$(OBJDIR)/pit.o: $(SRCDIR)/pit.c $(SRCDIR)/pit.h $(SRCDIR)/object.h $(SRCDIR)/table.h
$(CC) -o $(OBJDIR)/pit.o -c $(SRCDIR)/pit.c
$(OBJDIR)/project.o: $(SRCDIR)/project.c $(SRCDIR)/pit.h $(SRCDIR)/object.h $(SRCDIR)/table.h
$(CC) -o $(OBJDIR)/project.o -c $(SRCDIR)/project.c
$(OBJDIR)/table.o: $(SRCDIR)/table.c $(SRCDIR)/pit.h $(SRCDIR)/object.h $(SRCDIR)/table.h
$(CC) -o $(OBJDIR)/table.o -c $(SRCDIR)/table.c
$(OBJDIR)/task.o: $(SRCDIR)/task.c $(SRCDIR)/pit.h $(SRCDIR)/object.h $(SRCDIR)/table.h
$(CC) -o $(OBJDIR)/task.o -c $(SRCDIR)/task.c
$(OBJDIR)/util.o: $(SRCDIR)/util.c $(SRCDIR)/pit.h $(SRCDIR)/object.h $(SRCDIR)/table.h
$(CC) -o $(OBJDIR)/util.o -c $(SRCDIR)/util.c
install:
cp $(BINDIR)/$(APP) $(PREFIX)/bin/$(APP)
clean:
rm -f $(OBJDIR)/*.o
rm -f $(BINDIR)/$(APP)
rmdir $(OBJDIR)
rmdir $(BINDIR)
.PHONY : test
test:
./test/pit_test.rb
rm -f ./test/test.pitfile