source: liacs/coco/assignment1/Makefile@ 351

Last change on this file since 351 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: 896 bytes
Line 
1CC = gcc
2LEX = flex
3YACC = bison --yacc
4SHELL = /bin/sh
5
6WARNINGS = -Wall -ansi
7OTHERS = -g
8DEFINES = -DDEBUG
9
10CFLAGS = $(WARNINGS) $(OTHERS) $(DEFINES)
11LFLAGS =
12YFLAGS = --defines --debug --verbose
13LDFLAGS = -g
14LOADLIBS = -lfl -lm
15
16IMPORTANT = calc.[hly] \
17 Makefile
18
19all: calc
20
21# To be executed before the very first build
22first: dirs
23
24# Dependency stuff
25calc: gen/y.tab.o gen/lex.yy.o
26 $(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBS)
27
28gen/y.tab.h gen/y.tab.c: calc.y
29 $(YACC) $(YFLAGS) $< -o gen/y.tab.c
30
31gen/lex.yy.c: calc.l
32 $(LEX) $(LFLAGS) -o$@ $<
33
34clean:
35 rm -f gen/{lex.yy.c,y.tab.*,y.output,*.o} calc \
36 `find . -name core -o -name \*\.bak`
37
38backup:
39 tar cfz ../CoCo-`date +'%y%m%d-%H%M'`.tar.gz $(IMPORTANT)
40
41dirs:
42 mkdir gen
43
44# Show dependencies between .c files
45showdeps:
46 $(CC) -MM *.c
47
48# Dependency stuff
49gen/lex.yy.o: gen/lex.yy.c gen/y.tab.h
50gen/y.tab.o: gen/y.tab.c
Note: See TracBrowser for help on using the repository browser.