home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sa104os2.zip
/
SATHR104.ZIP
/
SATHER
/
MAKEFILE
< prev
next >
Wrap
Text File
|
1995-02-18
|
8KB
|
221 lines
# Copyright (C) International Computer Science Institute, 1994. COPYRIGHT
# NOTICE: This code is provided "AS IS" WITHOUT ANY WARRANTY and is subject
# to the terms of the SATHER LIBRARY GENERAL PUBLIC LICENSE contained in
# the file "Doc/License" of the Sather distribution. The license is also
# available from ICSI, 1947 Center St., Suite 600, Berkeley CA 94704, USA.
# -----> Please email comments to "sather-bugs@icsi.berkeley.edu". <-----
# Be sure to read the file Doc/Installation!
#
# You'll need to set these variables to be appropriate to your system.
#
# CFLAGS is only used during the bootstrap; CC options for regular
# compiles must be specified in System/CONFIG.pro.
#
# CS is the executable name.
#
# Set SHOME to an absolute path to the directory this Makefile is in (in
# other words, the top level sather directory)!!
#
# Don't forget to edit (or at least inspect) the file System/CONFIG.pro.
CPP= icc /Q /Pcde
CC= icc
CFLAGS= /Q /O /B/STACK:200000 /B/ALIGN:32
CS= cs
CSDEBUG= csdb
SHOME= f:\sather
TEST= test
GC_MKFL= Makefile.ibm
SYS_MKFL= Makefile.ibm
BOOT_MKFL= Makefile.ibm
DIST_NAME= Sa104os2.zip
INNER_NAME = Sathr104.zip
!IFDEF verbose
RED=
MAK=
VERB= -verbose
!ELSE
!IFDEF silent
!CMDSWITCHES +S
RED= >nul
MAK= /S
VERB=
!ELSE
RED=
MAK=
VERB=
!ENDIF
!ENDIF
SYSTEM= MakeGCLib MakeBaseLib System\MACROS System\CONFIG
BOOTCS= $(SHOME)\Boot\$(CS)
COMP_FILES= Compiler\am.sa Compiler\am_out.sa Compiler\be.sa Compiler\call.sa Compiler\cs.sa Compiler\elt.sa Compiler\global.sa Compiler\ident.sa Compiler\ifc.sa Compiler\impl.sa Compiler\inline.sa Compiler\options.sa
COMP_FILES2= Compiler\parse.sa Compiler\prog.sa Compiler\sig.sa Compiler\tp.sa Compiler\tr.sa Compiler\trans.sa
LIB_FILES= Library\abstract.sa Library\aref.sa Library\array.sa Library\array2.sa Library\aval.sa Library\bool.sa Library\char.sa Library\cpx.sa Library\err.sa Library\file.sa Library\flist.sa Library\flt.sa
LIB_FILES2= Library\flt_othr.sa Library\fltd.sa Library\fmap.sa Library\fqset.sa Library\fset.sa Library\fstr.sa Library\glob.sa Library\in.sa Library\int.sa Library\inti.sa Library\mat.sa Library\misc.sa
LIB_FILES3= Library\next.sa Library\out.sa Library\rat.sa Library\rnd.sa Library\str.sa Library\str_curs.sa Library\sys.sa Library\test.sa Library\tup.sa Library\unix.sa Library\vec.sa
# Make the boot compiler and give it a workout on itself and some test cases
all: env_off $(SYSTEM) $(BOOTCS) Compiler\$(CS).exe
# Make the boot compiler and give it a workout on itself (debug_mode) and some test cases
alldebug: env_off $(SYSTEM) $(BOOTCS) Compiler\$(CSDEBUG).exe
# Make and test everything
testall: all fixedpoint_test
system_stuff: $(SYSTEM)
env_off:
set SATHER_COMMANDS=
# The compiler which ends up in Compiler\ is the "fast" executable,
# which means that checking is turned off and optimizations are on.
Compiler\$(CS).exe: $(BOOTCS).exe $(COMP_FILES) $(COMP_FILES2) $(COMP_FILES3) $(LIB_FILES) $(LIB_FILES2) $(LIB_FILES3)
cd Compiler
$(BOOTCS) -home $(SHOME) -com cs.prm -o $(CS) -fast -only_reachable $(VERB)
cd ..\Test
..\Compiler\$(CS) -home $(SHOME) -com tests.prm -o $(TEST) $(VERB)
.\$(TEST) > test.log
cd ..
Compiler\$(CSDEBUG).exe: $(BOOTCS).exe $(COMP_FILES) $(COMP_FILES2) $(COMP_FILES3) $(LIB_FILES) $(LIB_FILES2) $(LIB_FILES3)
cd Compiler
$(BOOTCS) -home $(SHOME) -com cs.prm -o $(CSDEBUG) -check all -debug -only_reachable -output_C -deterministic $(VERB)
cd ..\Test
..\Compiler\$(CSDEBUG) -home $(SHOME) -com tests.prm -o $(TEST) $(VERB)
.\$(TEST) > test.log
cd ..
$(BOOTCS):
cd Boot\cs.cod
nmake -nologo $(MAK) -f $(BOOT_MKFL) CC=$(CC) CS=$(BOOTCS) CFLAGS="$(CFLAGS)" RED="$(RED)"
cd ..\..
# The next four rules just make the stuff in System\
System\MACROS: System\MACROS.pro
$(CPP) System\MACROS.pro > System\MACROS
System\CONFIG: System\CONFIG.pro
$(CPP) System\CONFIG.pro > System\CONFIG
MakeBaseLib:
cd System
nmake -nologo $(MAK) -f $(SYS_MKFL) CC=$(CC) CFLAGS="$(CFLAGS)" RED="$(RED)"
cd ..
MakeGCLib:
cd System\GC
nmake -nologo $(MAK) -f $(GC_MKFL) CC=$(CC) RED="$(RED)"
cd ..\..
# There are two tests. The first is the test classes in the library,
# which is pretty straightforward. The second is a full fixed-point
# compilation of the compiler, which can take quite a while.
quick_test:
cd Test
..\Compiler\$(CS) -home $(SHOME) -com tests.prm -o $(TEST) $(VERB)
.\$(TEST) > test.log
cd ..
db_quick_test:
cd Test
..\Compiler\$(CSDEBUG) -home $(SHOME) -com tests.prm -o $(TEST) $(VERB)
.\$(TEST) > test.log
cd ..
# The fixed-point test does the following:
#
# 1. Compile using Compiler/cs.
# 2. Compile using result.
# 3. Compile using _that_ result.
# 4. Compare C files generated by (2) and (3).
# 5. Clean up.
#
# This can take quite a long time so I've removed it from the things
# that occur by default during a build.
fixedpoint_test:
cd Test
if exist cs1.cod ..\System\deltree /y /f cs1.cod $(RED)
if exist cs2.cod ..\System\deltree /y /f cs2.cod $(RED)
if exist cs3.cod ..\System\deltree /y /f cs3.cod $(RED)
if exist *.exe del *.exe
..\Compiler\$(CS) -com ..\Compiler\cs.prm -home $(SHOME) -output_C -o cs3 -O -deterministic -check all $(VERB)
rename cs3.exe cs2.exe
rename cs3.cod cs1.cod
cs2 -com ..\Compiler\cs.prm -home $(SHOME) -output_C -o cs3 -O -deterministic -check all $(VERB)
rename cs2.exe cs1.exe
rename cs3.exe cs2.exe
rename cs3.cod cs2.cod
cs2 -com ..\Compiler\cs.prm -home $(SHOME) -output_C -o cs3 -O -deterministic -check all $(VERB)
cd ..
@echo If all went well, the files in $(SHOME)\Test\cs2.cod are identical to
@echo the files in $(SHOME)\Test\cs3.cod.
@echo Consider executing "nmake fixedpoint_clean" after comparing these files.
fixedpoint_clean:
cd Test
if exist cs1.cod ..\System\deltree /y /f cs1.cod $(RED)
if exist cs2.cod ..\System\deltree /y /f cs2.cod $(RED)
if exist cs3.cod ..\System\deltree /y /f cs3.cod $(RED)
if exist *.exe del *.exe
cd ..
clean:
if exist *.log del *.log
cd Test
if exist $(TEST).cod ..\System\deltree /y /f $(TEST).cod $(RED)
if exist cs1.cod ..\System\deltree /y /f cs1.cod $(RED)
if exist cs2.cod ..\System\deltree /y /f cs2.cod $(RED)
if exist cs3.cod ..\System\deltree /y /f cs3.cod $(RED)
if exist *.exe del *.exe
if exist *.log del *.log
cd ..\Compiler
if exist $(CS).cod ..\System\deltree /y /f $(CS).cod $(RED)
if exist $(CSDEBUG).cod ..\System\deltree /y /f $(CSDEBUG).cod $(RED)
if exist $(CSDEBUG).exe del $(CSDEBUG).exe
if exist *.log del *.log
cd ..\System
if exist *.obj del *.obj
if exist *.bak del *.bak
if exist *.log del *.log
cd GC
if exist *.obj del *.obj
if exist *.exe del *.exe
if exist *.bak del *.bak
if exist *.p del *.p
if exist *.log del *.log
if exist Cord\*.obj del Cord\*.obj
if exist Cord\*.exe del Cord\*.exe
cd ..\..\Boot
if exist *.exe del *.exe
if exist $(CS).cod\*.obj del $(CS).cod\*.obj
if exist *.log del *.log
cd ..
# You'll never want to do these
distribution: clean make_zip
make_zip:
if exist Compiler\cs.exe del Compiler\cs.exe
cd ..
if exist $(DIST_NAME) del $(DIST_NAME)
if exist $(INNER_NAME) del $(INNER_NAME)
d:\dosutil\pkzip -ex -r -P $(INNER_NAME) sather\*.*
d:\dosutil\pkunzip -t $(INNER_NAME)
d:\dosutil\pkzip $(DIST_NAME) $(INNER_NAME) $(SHOME)\Readme.1st $(SHOME)\file_id.diz
d:\dosutil\pkunzip -t $(DIST_NAME)
del $(INNER_NAME)
cd $(SHOME)