Revision 4e5d304eb7cd5589b924ffb8b423b6f15511b35d authored by Ron Burkey on 20 October 2018, 17:47:00 UTC, committed by Ron Burkey on 20 October 2018, 17:47:00 UTC
the recently-added documents about YUL, was transcribed.  Because the
original program contained a deliberate error in YUL (as well as some
constructs that have unintentionally become errors in yaYUL), I've
provided it in two forms:  TRIVIUM (which matches the original scan,
to the extent feasible) and TRIVIUM-repaired (which has the deliberate
and unintentional errors fixed, but otherwise retains the identical
functionality of the original).
1 parent c6c292e
Raw File
Makefile
# Copyright 2005,2009,2016 Ronald S. Burkey <info@sandroid.org>
# 
# This file is part of yaAGC.
#
# yaAGC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# yaAGC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with yaAGC; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# Filename:	Makefile
# Purpose:	Makefile for the yaLEMAP assembler and friends.
# Mods:		01/12/05 RSB.	Adapted from yaYUL's makefile.
#		01/18/05 RSB	Added FP8. 
#		01/23/05 RSB	Added FP6.
#		04/30/05 RSB	Added CFLAGS.  No longer is 'clean' 
#				for the default target.
#		06/02/05 RSB	FP6.bin and FP8.bin added to list of files
#				to install.
#		08/04/05 RSB	Took care of FP[6].symtab
#		03/06/09 RSB	Added the 'all-archs' target, and modified
#				'clean' to account for Win32 and Mac
#				versions of the program as built on Linux.  
#				The 'all-archs' target assumes that 
#				IMCROSS (www.sandroid.org/imcross) is 
#				installed.
#		2009-07-04 RSB	Added --html switch.
#		2016-08-28 RSB	For the targets that build the html
#				listings, the annotation files weren't
#				accessible.
#		2017-10-17 MAS	Added checking of the FP6 binsource
#				against the FP6 assembly.
#		2017-11-08 MAS	Added checking of the FP8 binsource
#				against the FP6 assembly.

ifndef PREFIX
ifdef MSYSTEM
PREFIX=/mingw
SUFFIX=.exe
endif
else	# MSYSTEM
PREFIX=/usr/local
endif	# MSYSTEM

.PHONY:	default
default: binLEMAP SampleCodeAGS.lst \
	../FP8/FP8.lst ../FP8/FP8.bin ../FP8/FP8.symtab \
	../FP6/FP6.lst ../FP6/FP6.bin ../FP6/FP6.symtab \
	../FP8/FP8.aea.html ../FP6/FP6.aea.html

.PHONY: all-archs
all-archs: default binLEMAP.exe binLEMAP-macosx yaLEMAP.exe yaLEMAP-macosx

../FP8/FP8.lst ../FP8/FP8.bin ../FP8/FP8.symtab: yaLEMAP ../FP8/FP8.aea
	./yaLEMAP --unpound-page ../FP8/FP8.aea
	./binLEMAP <../FP8/FP8.binsource
	diff -s yaLEMAP.bin binLEMAP.bin
	mv yaLEMAP.bin ../FP8/FP8.bin
	mv yaLEMAP.symtab ../FP8/FP8.symtab
	mv yaLEMAP.lst ../FP8/FP8.lst

../FP8/FP8.aea.html: yaLEMAP ../FP8/FP8.aea
	cp ../FP8/Apollo32.png ../FP8/Main.annotation ../FP8/Default.style .
	./yaLEMAP --html ../FP8/FP8.aea

../FP6/FP6.lst ../FP6/FP6.bin ../FP6/FP6.symtab: yaLEMAP ../FP6/FP6.aea
	./yaLEMAP --unpound-page ../FP6/FP6.aea
	./binLEMAP <../FP6/FP6.binsource
	diff -s yaLEMAP.bin binLEMAP.bin
	mv yaLEMAP.bin ../FP6/FP6.bin
	mv yaLEMAP.symtab ../FP6/FP6.symtab
	mv yaLEMAP.lst ../FP6/FP6.lst

../FP6/FP6.aea.html: yaLEMAP ../FP6/FP6.aea
	cp ../FP8/Apollo32.png ../FP6/Main.annotation ../FP6/Default.style .
	./yaLEMAP --html ../FP6/FP6.aea

SampleCodeAGS.lst: yaLEMAP SampleCodeAGS.aea
	@echo "=============================================================================="
	@echo \*\*\* The following operation should result in 13 errors and 3 warnings. \*\*\*
	./yaLEMAP --compare=binLEMAP.bin SampleCodeAGS.aea
	@echo "=============================================================================="
	mv yaLEMAP.bin SampleCodeAGS.bin
	mv yaLEMAP.lst SampleCodeAGS.lst

binLEMAP: binLEMAP.c
	${cc} ${CFLAGS} -o $@ $^
	./binLEMAP <SampleCodeAGS.binsource

binLEMAP.exe: binLEMAP.c
	i386-mingw32-${cc} ${CFLAGS} -o $@ $^

binLEMAP-macosx: binLEMAP.c
	powerpc-apple-darwin9-${cc} -arch i386 -arch ppc ${CFLAGS} -o $@ $^

yaLEMAP: yaLEMAP.c ../yaYUL/SymbolTable.c
	${cc} ${CFLAGS} -o $@ $^ -lm

yaLEMAP.exe: yaLEMAP.c ../yaYUL/SymbolTable.c
	i386-mingw32-${cc} ${CFLAGS} -o $@ $^ -lm

yaLEMAP-macosx: yaLEMAP.c ../yaYUL/SymbolTable.c
	powerpc-apple-darwin9-${cc} -arch i386 -arch ppc ${CFLAGS} -o $@ $^ -lm

.PHONY:	clean
clean:
	rm -f binLEMAP yaLEMAP *.exe *-macosx \
		*.o *~ yaLEMAP.binsource \
		binLEMAP.bin SampleCodeAGS.bin SampleCodeAGS.lst \
		../FP8/FP8.bin ../FP8/FP8.lst ../FP8/*.symtab \
		../FP6/FP6.bin ../FP6/FP6.lst ../FP6/*.symtab \
		../FP8/FP8.aea.html ../FP6/FP6.aea.html \
		Apollo32.png Main.annotation Default.style

.PHONY:	install
install: default
	cp binLEMAP ${PREFIX}/bin/binLEMAP${SUFFIX} 
	cp yaLEMAP ${PREFIX}/bin/yaLEMAP${SUFFIX}
	-chmod ugo+x ${PREFIX}/bin/binLEMAP${SUFFIX} ${PREFIX}/bin/yaLEMAP${SUFFIX}
	mv ../FP6/FP6.bin ../FP6/FP6.symtab ${PREFIX}/bin
	mv ../FP8/FP8.bin ../FP8/FP8.symtab ${PREFIX}/bin
	

%.o:	%.c ../yaYUL/yaYUL.h
	${cc} ${CFLAGS0} -DNVER=${NVER} -DINSTALLDIR=${PREFIX} -c -o $@ $<
	

back to top