-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
93 lines (75 loc) · 1.69 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
#
# Created by gmakemake (Ubuntu Jul 25 2014) on Wed Nov 22 20:54:04 2017
#
#
# Definitions
#
.SUFFIXES:
.SUFFIXES: .a .o .c .C .cpp .s .S
.c.o:
$(COMPILE.c) $<
.C.o:
$(COMPILE.cc) $<
.cpp.o:
$(COMPILE.cc) $<
.S.s:
$(CPP) -o $*.s $<
.s.o:
$(COMPILE.cc) $<
.c.a:
$(COMPILE.c) -o $% $<
$(AR) $(ARFLAGS) $@ $%
$(RM) $%
.C.a:
$(COMPILE.cc) -o $% $<
$(AR) $(ARFLAGS) $@ $%
$(RM) $%
.cpp.a:
$(COMPILE.cc) -o $% $<
$(AR) $(ARFLAGS) $@ $%
$(RM) $%
CC = gcc
CXX = g++
RM = rm -f
AR = ar
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
CPP = $(CPP) $(CPPFLAGS)
########## Flags from header.mak
CFLAGS = -std=c99 -ggdb -Wall -Wextra -pedantic
CLIBFLAGS = -lm
########## End of flags from header.mak
CPP_FILES =
C_FILES = evaluate.c fred.c processor.c stack.c symbolTable.c
PS_FILES =
S_FILES =
H_FILES = evaluate.h processor.h stack.h symbolTable.h
SOURCEFILES = $(H_FILES) $(CPP_FILES) $(C_FILES) $(S_FILES)
.PRECIOUS: $(SOURCEFILES)
OBJFILES = evaluate.o processor.o stack.o symbolTable.o
#
# Main targets
#
all: fred
fred: fred.o $(OBJFILES)
$(CC) $(CFLAGS) -o fred fred.o $(OBJFILES) $(CLIBFLAGS)
#
# Dependencies
#
evaluate.o: evaluate.h stack.h symbolTable.h
fred.o: evaluate.h processor.h stack.h symbolTable.h
processor.o: evaluate.h processor.h stack.h symbolTable.h
stack.o: stack.h
symbolTable.o: symbolTable.h
#
# Housekeeping
#
Archive: archive.tgz
archive.tgz: $(SOURCEFILES) Makefile
tar cf - $(SOURCEFILES) Makefile | gzip > archive.tgz
clean:
-/bin/rm -f $(OBJFILES) fred.o core
realclean: clean
-/bin/rm -f fred