-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
52 lines (37 loc) · 660 Bytes
/
makefile
File metadata and controls
52 lines (37 loc) · 660 Bytes
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
# Make file
#
# based on http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/
IDIR =include
CC=gcc
CFLAGS=-I$(IDIR)
ODIR=obj
LDIR =lib
#LIBS=-lm
LIBS=-lm
_DEPS = \
$(ODIR) \
cf.h \
cf_basic_test_suite.h \
cf_unit_test.h \
cf.c \
cf_basic_test_suite.c \
cf_unit_test.c \
main.c
#DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
DEPS = $(_DEPS)
_OBJ = \
main.o \
cf.o \
cf_basic_test_suite.o \
cf_unit_test.o
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
main_exe: $(OBJ)
gcc -o $@ $^ $(CFLAGS) $(LIBS)
$(ODIR):
mkdir $(ODIR)
$(ODIR)/%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
.PHONY: clean
clean:
rm -f $(ODIR)/*.o *~ core $(INCDIR)/*~
rm main_exe