-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
78 lines (58 loc) · 2.76 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
SHELL = /bin/sh
SRCDIR = ./src
OBJDIR = ./obj
INCLUDEDIR = ./include
BINDIR = ./bin
ifdef DEBUG
CFLAGS = -Wall -std=c99 -o2 -I $(INCLUDEDIR) -g
else
CFLAGS = -Wall -std=c99 -o2 -I $(INCLUDEDIR)
endif
.SUFFIXES:
.SUFFIXES: .c .o
.PHONY: clean blip
blip: $(BINDIR)/blip
$(BINDIR)/blip: $(OBJDIR)/main.o $(OBJDIR)/lexeme.o $(OBJDIR)/lex.o $(OBJDIR)/darray.o \
$(OBJDIR)/bigint.o $(OBJDIR)/bigfloat.o $(OBJDIR)/eval.o $(OBJDIR)/environment.o $(OBJDIR)/builtins.o \
$(OBJDIR)/parser.o $(OBJDIR)/pair.o $(OBJDIR)/prettyprinter.o | $(BINDIR)
$(CC) $(CFLAGS) -o $@ $^
$(OBJDIR)/bigfloat.o: $(SRCDIR)/bigfloat.c $(INCLUDEDIR)/bigfloat.h | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/bigint.o: $(SRCDIR)/bigint.c $(INCLUDEDIR)/bigint.h | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/builtins.o: $(SRCDIR)/builtins.c $(INCLUDEDIR)/builtins.h $(INCLUDEDIR)/environment.h \
$(INCLUDEDIR)/lexeme.h $(INCLUDEDIR)/bigint.h $(INCLUDEDIR)/bigfloat.h $(INCLUDEDIR)/eval.h \
$(INCLUDEDIR)/pair.h | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/darray.o: $(SRCDIR)/darray.c $(INCLUDEDIR)/darray.h | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/environment.o: $(SRCDIR)/environment.c $(INCLUDEDIR)/environment.h $(INCLUDEDIR)/lexeme.h \
$(INCLUDEDIR)/bigint.h $(INCLUDEDIR)/pair.h | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/eval.o: $(SRCDIR)/eval.c $(INCLUDEDIR)/eval.h $(INCLUDEDIR)/lexeme.h $(INCLUDEDIR)/bigint.h \
$(INCLUDEDIR)/environment.h $(INCLUDEDIR)/prettyprinter.h $(INCLUDEDIR)/builtins.h $(INCLUDEDIR)/pair.h |$(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/main.o: $(SRCDIR)/main.c $(INCLUDEDIR)/eval.h $(INCLUDEDIR)/lexeme.h \
$(INCLUDEDIR)/bigint.h $(INCLUDEDIR)/parser.h $(INCLUDEDIR)/lex.h $(INCLUDEDIR)/environment.h \
$(INCLUDEDIR)/prettyprinter.h | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/lexeme.o: $(SRCDIR)/lexeme.c $(INCLUDEDIR)/lexeme.h $(INCLUDEDIR)/bigint.h \
$(INCLUDEDIR)/bigfloat.h | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/parser.o: $(SRCDIR)/parser.c $(INCLUDEDIR)/lex.h $(INCLUDEDIR)/lexeme.h $(INCLUDEDIR)/bigint.h \
$(INCLUDEDIR)/parser.h $(INCLUDEDIR)/pair.h | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/prettyprinter.o: $(SRCDIR)/prettyprinter.c $(INCLUDEDIR)/lex.h $(INCLUDEDIR)/lexeme.h \
$(INCLUDEDIR)/bigint.h $(INCLUDEDIR)/bigfloat.h $(INCLUDEDIR)/prettyprinter.h | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/lex.o: $(SRCDIR)/lex.c $(INCLUDEDIR)/lex.h $(INCLUDEDIR)/lexeme.h $(INCLUDEDIR)/bigint.h \
$(INCLUDEDIR)/darray.h $(INCLUDEDIR)/bigfloat.h $(INCLUDEDIR)/pair.h | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/pair.o: $(SRCDIR)/pair.c $(INCLUDEDIR)/pair.h $(INCLUDEDIR)/lexeme.h $(INCLUDEDIR)/bigint.h
$(CC) $(CFLAGS) -c -o $@ $<
clean:
$(RM) -r $(OBJDIR) $(BINDIR)
$(OBJDIR):
mkdir $@
$(BINDIR):
mkdir $@