-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
60 lines (47 loc) · 1.84 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
# to make for another target CPU, redefine PROC to the name of the target
# processor, e.g., 68000
PROC =6502
MACROSS_OBJECTS = actions_$(PROC).o buildStuff1.o buildStuff2.o \
buildStuff3.o builtInFunctions.o \
builtInFunsSD_$(PROC).o debugPrint.o \
debugPrintSD_$(PROC).o emitBranch_$(PROC).o \
emitStuff.o encode.o errorStuff.o \
expressionSemantics.o fixups.o garbage.o globals.o \
initialize.o lexer.o listing.o lookups.o \
macrossTables_$(PROC).o main.o object.o \
operandStuffSD_$(PROC).o parserMisc.o \
semanticMisc.o statementSemantics.o \
structSemantics.o tokenStrings_$(PROC).o y.tab.o
# Macross is not 64-bit clean and it does a lot of silent downcasting
# to simulate subclasses and uses int and void * interchangably a
# bunch. gcc calls these the int-conversion and
# incompatible-pointer-types warnings.
CFLAGS=-m32 -O2 -ansi -DYYDEBUG -DTARGET_CPU=CPU_$(PROC)
LDFLAGS=-m32
# If yacc is notionally present on a system, it's usually actually
# bison in a compatibility mode. bison is available by name more often
# than yacc itself is.
YACC=bison -y
#YACC=yacc
# Pick a compiler if you have one in particular you want.
CC=cc
#CC=gcc
#CC=clang
macross: $(MACROSS_OBJECTS)
$(CC) $(LDFLAGS) -o macross $(MACROSS_OBJECTS)
# This is a switcher program between multiple versions of Macross, not
# really a build product
# driver: driver.c
# cc $(CFLAGS) -o driver driver.c
y.tab.c y.tab.h: macross_$(PROC).y
$(YACC) -d macross_$(PROC).y
clean:
rm -f *.o y.tab.c y.tab.h macross
love:
@echo "Not war?"
.c.o:
$(CC) $(CFLAGS) -c $<
Makefile.depend:
makedepend -Y -DTARGET_CPU=CPU_$(PROC) -f - *.c > Makefile.depend
depend: Makefile.depend
include Makefile.depend