2014-05-04 05:20:34 +00:00
|
|
|
# to make for another target CPU, redefine PROC to the name of the target
|
|
|
|
# processor, e.g., 68000
|
|
|
|
PROC =6502
|
|
|
|
|
2016-01-25 02:11:39 +00:00
|
|
|
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
|
2014-05-04 05:20:34 +00:00
|
|
|
|
2016-01-24 01:45:47 +00:00
|
|
|
# Macross is not 64-bit clean and it does a lot of silent downcasting
|
|
|
|
# to simulate subclasses and uses int and void * interchangably a
|
2016-01-24 08:04:00 +00:00
|
|
|
# bunch. gcc calls these the int-conversion and
|
|
|
|
# incompatible-pointer-types warnings.
|
2016-02-09 02:04:00 +00:00
|
|
|
CFLAGS=-m32 -O2 -ansi -DYYDEBUG -DTARGET_CPU=CPU_$(PROC)
|
2016-01-25 02:11:39 +00:00
|
|
|
LDFLAGS=-m32
|
2016-01-24 01:45:47 +00:00
|
|
|
|
2016-01-23 08:36:58 +00:00
|
|
|
# If yacc is notionally present on a system, it's usually actually
|
|
|
|
# bison in a compatibility mode. bison is available by name more often
|
2016-01-24 01:45:47 +00:00
|
|
|
# than yacc itself is.
|
|
|
|
YACC=bison -y
|
|
|
|
#YACC=yacc
|
2014-05-04 05:47:33 +00:00
|
|
|
|
2016-02-09 02:10:23 +00:00
|
|
|
# Pick a compiler if you have one in particular you want.
|
|
|
|
CC=cc
|
|
|
|
#CC=gcc
|
2016-01-25 02:11:39 +00:00
|
|
|
#CC=clang
|
2014-05-04 05:20:34 +00:00
|
|
|
|
2016-01-25 02:11:39 +00:00
|
|
|
macross: $(MACROSS_OBJECTS)
|
|
|
|
$(CC) $(LDFLAGS) -o macross $(MACROSS_OBJECTS)
|
2014-05-04 05:20:34 +00:00
|
|
|
|
2016-01-25 02:11:39 +00:00
|
|
|
# This is a switcher program between multiple versions of Macross, not
|
|
|
|
# really a build product
|
|
|
|
# driver: driver.c
|
|
|
|
# cc $(CFLAGS) -o driver driver.c
|
2014-05-04 05:20:34 +00:00
|
|
|
|
|
|
|
y.tab.c y.tab.h: macross_$(PROC).y
|
2016-01-23 08:36:58 +00:00
|
|
|
$(YACC) -d macross_$(PROC).y
|
2014-05-04 05:20:34 +00:00
|
|
|
|
2016-01-24 05:51:21 +00:00
|
|
|
clean:
|
2016-01-25 02:11:39 +00:00
|
|
|
rm -f *.o y.tab.c y.tab.h macross
|
2014-05-04 05:20:34 +00:00
|
|
|
|
|
|
|
love:
|
|
|
|
@echo "Not war?"
|
|
|
|
|
2016-01-25 02:11:39 +00:00
|
|
|
.c.o:
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
|
2016-02-09 02:04:00 +00:00
|
|
|
Makefile.depend:
|
|
|
|
makedepend -Y -DTARGET_CPU=CPU_$(PROC) -f - *.c > Makefile.depend
|
2016-01-25 02:11:39 +00:00
|
|
|
|
2016-02-09 02:04:00 +00:00
|
|
|
depend: Makefile.depend
|
|
|
|
|
|
|
|
include Makefile.depend
|