# Copyright:	Public domain.
# Filename:	Makefile.Win32
# Purpose:	Makefile for Luminary 1C, revision 131.
#		(The source code for the Lunar Module's (LM)
#		Apollo Guidance Computer (AGC) for Apollo 13 and Apollo 14.)
# Assembler:	yaYUL
# Contact:	Ron Burkey <info@sandroid.org>.
# Mod history:	11/02/03 RSB.	Adapted from the Linux Makefile.
#		06/11/04 RSB	Added -DMAIN_PROGRAM to CheckDec.exe.
#		08/14/04 RSB	Put the yaYUL/Luminary131 regression test back in.
#		08/18/04 RSB	... and fixed it.
#		04/30/05 RSB	Added CFLAGS
#		07/28/05 RSB	Added the symtab

SOURCE:=$(wildcard *.s)
TARGETS=webb2burkey-rope.exe Oct2Bin.exe CheckDec.exe Luminary131.bin Luminary131.lst Luminary131.symtab

default:	$(TARGETS)

webb2burkey-rope.exe: webb2burkey-rope.c
	gcc ${CFLAGS} "-DNVER=${NVER}" -o webb2burkey-rope.exe webb2burkey-rope.c
	
Oct2Bin.exe:	Oct2Bin.c
	gcc ${CFLAGS} "-DNVER=${NVER}" -o Oct2Bin.exe Oct2Bin.c
	
CheckDec.exe:	CheckDec.c
	gcc ${CFLAGS} "-DNVER=${NVER}" -DMAIN_PROGRAM -o CheckDec.exe CheckDec.c -lm
	
Luminary131.bin: Oct2Bin.exe Luminary131.binsource
	./Oct2Bin.exe <Luminary131.binsource
	mv Oct2Bin.bin Luminary131.bin

Luminary131.lst Luminary131.symtab: ${SOURCE}
	../yaYUL/yaYUL.exe --force MAIN.s >Luminary131.lst
	mv MAIN.s.symtab Luminary131.symtab
	diff -s MAIN.s.bin Luminary131.bin
	
clean:
	-rm $(TARGETS)
	
install:	default
	cp Luminary131.bin Luminary131.symtab Oct2Bin.exe CheckDec.exe webb2burkey-rope.exe /mingw/bin
	rm *.symtab
	
	
