forked from benfowler/c-minus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (31 loc) · 964 Bytes
/
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
#######################################################################
# NAME: Benjamin Fowler
# NUMBER: 02251132
# SUBJECT: Modern Compiler Construction.
# INSTRUCTOR: Dr Wayne Kelly
#######################################################################
# MODULE: UNIX Makefile.
# DATE STARTED: March 23, 2000.
# LAST EDITED: March 23, 2000.
#######################################################################
CFLAGS = -g3 -W -Wall -ansi -pedantic
CC = gcc
BIN = compiler
OBJ_FILES = Main.o Scan.o Parse.o Util.o SymTab.o Analyse.o CGen.o
$(BIN): $(OBJ_FILES)
$(CC) -g -o $(BIN) $(OBJ_FILES)
target: $(BIN)
#
# because the "clean" target isn't actually a file, we need to designate it
# as "phony" so Make dosen't get confused.
#
.PHONY: clean
clean:
rm -f core tags $(BIN) $(OBJ_FILES) *~ examples/*~ depends
ctags:
ctags *
%.o: %.c
$(CC) $(CFLAGS) -c $<
depends:
gcc -MM *.c > depends
include depends