##############################################################################
## subMakefile for as1600
##############################################################################

ASMSRC = asm/as1600.c asm/fraosub.c asm/frapsub.c asm/frasmain.c asm/fryylex.c
ASMSRC+= asm/cpp_main.cpp
ASMOBJ = asm/as1600.o asm/fraosub.o asm/frapsub.o asm/frasmain.o asm/fryylex.o
ASMOBJ+= asm/cpp_main.o
ASMOBJ+= icart/icartrom.o misc/crc16.o plat/gnu_getopt.o icart/icartbin.o
IMOBJ  = imasm/c_wrap.o imasm/parser.o imasm/token.o imasm/strfifo.o 


$(B)/as1600$(X): $(ASMOBJ) $(IMOBJ) $(BCOBJ) file/file.o misc/ll.o
	$(CXX) -o $(B)/as1600$(X) $(CFLAGS) $(IMOBJ) $(ASMOBJ) $(BCOBJ) file/file.o misc/ll.o

asm/as1600.o:   asm/fraebin.h asm/fraeuni.h asm/fragcon.h asm/frasmdat.h
asm/fraosub.o:  asm/fraebin.h asm/fraeuni.h asm/fragcon.h asm/frasmdat.h
asm/frapsub.o:  asm/fraebin.h asm/fraeuni.h asm/fragcon.h asm/frasmdat.h
asm/frasmain.o: asm/fraebin.h asm/fraeuni.h asm/fragcon.h asm/frasmdat.h
asm/fryylex.o:  asm/fraebin.h asm/fraeuni.h asm/fragcon.h asm/frasmdat.h

asm/as1600.o:   asm/getopt.h asm/as1600.y asm/as1600.c asm/as1600.h
asm/fraosub.o:  asm/getopt.h asm/as1600.y asm/as1600.c asm/as1600.h
asm/frapsub.o:  asm/getopt.h asm/as1600.y asm/as1600.c asm/as1600.h
asm/frasmain.o: asm/getopt.h asm/as1600.y asm/as1600.c asm/as1600.h
asm/fryylex.o:  asm/getopt.h asm/as1600.y asm/as1600.c asm/as1600.h

asm/frasmain.o: imasm/c_wrap.h
asm/fryylex.o:  imasm/c_wrap.h

asm/fraosub.o:  config.h icart/icartrom.h icart/icartbin.h

asm/cpp_main.o: asm/cpp_main.cpp
	$(CXX) $(CFLAGS) -o asm/cpp_main.o -c asm/cpp_main.cpp

asm/as1600.c asm/as1600.h: asm/as1600.y
	bison -o asm/as1600.c --defines asm/as1600.y

TOCLEAN += $(B)/as1600$(X) $(ASMOBJ) $(IMOBJ) asm/as1600.c asm/as1600.h
PROGS   += $(B)/as1600$(X)
