source: liacs/coco/assignment3/Makefile@ 291

Last change on this file since 291 was 2, checked in by Rick van der Zwet, 15 years ago

Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)

File size: 1.4 KB
RevLine 
[2]1#
2# Makefile for assignment 3 of the Compiler Construction course.
3# Fall 2008, LIACS, Leiden University.
4#
5
6CC = g++
7LEX = flex
8YACC = bison --yacc
9
10WARNINGS = -Wall -ansi
11OTHERS = -m32 -g
12DEFINES = -DDEBUG
13IDIRS = -I.
14
15CFLAGS = $(WARNINGS) $(OTHERS) $(DEFINES) $(IDIRS)
16LFLAGS =
17YFLAGS = --defines --debug --verbose
18LDFLAGS = -m32 -g
19LOADLIBS = -lfl -lm
20
21# If you want to add another C/C++ file to the compiler, add the name of the
22# corresponding .o file to the OBJFILES macro below:
23OBJFILES = debug.o main.o ICGenerator.o
24OBJDIR = gen/
25OBJS = $(addprefix $(OBJDIR),$(OBJFILES))
26
27# Precompiled object files
28POBJFILES = types.o SyntaxTree.o Node.o Symbol.o SymbolTable.o Scope.o \
29 IntermediateCode.o IStatement.o IOperand.o IOperator.o
30POBJDIR = obj/
31POBJS = $(addprefix $(POBJDIR),$(POBJFILES))
32
33IMPORTANT = comp.[hly] *.h *.c *.cc \
34 Makefile
35
36.PHONY: all first clean backup dirs showdeps
37
38all: comp
39
40# To be executed before the very first build
41first: dirs
42
43# Dependency stuff
44comp: $(POBJDIR)y.tab.o $(POBJDIR)lex.yy.o $(OBJS) $(POBJS)
45 $(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBS)
46
47clean:
48 rm -f $(OBJDIR)*.o comp \
49 `find . -name core -o -name \*\.bak`
50
51backup:
52 tar cfz ../CoCo-`date +'%y%m%d-%H%M'`.tar.gz $(IMPORTANT)
53
54dirs:
55 mkdir gen
56
57# Show dependencies between .c files
58showdeps:
59 $(CC) -MM *.c *.cc
60
61# Dependency stuff
62$(OBJDIR)%.o: %.c
63 $(CC) $(CFLAGS) -c -o $@ $<
64
65$(OBJDIR)%.o: %.cc
66 $(CC) $(CFLAGS) -c -o $@ $<
Note: See TracBrowser for help on using the repository browser.