#
# This make file is the main make file of the IRIT solid modeller and its
# auxilary tools. Uses DJGCC gcc port form 386 machines.
#
# Do the following before run make:
#
# 1. Edit 'makeflag.djg' for the exact path names to ne used for libraries and
#    binaries. Also set the C compiler and linker flags.
# 2. You will have to build libgif.a from the giflibxx.zip file (see readme.1st
#    for ftp location). Otherwise you would not be able to build poly3d-r.
#
# Only large model is created here.
#
#				Gershon Elber, Nov. 1991
#

# Works only on TC++ 1.0 make and up - swap out make before invoking command.
.SWAP

# Includes generic definitions.
!include "makeflag.djg"

all:	misc_lib cagd_lib prsr_lib geom_lib \
	grapdrvs irit poly3d-h poly3d-r illustrt iritfltr docs
	type &&!
Before executing the test suite and/or any usage of this package
you will have to issue the following commands:

set IRIT_PATH=$(BIN_DIR)/
set path = %path%;$(BIN_DIR)

or similar.
!

#
# Uncommend the following variable to only see the actions taken.
#
# VIEW_ONLY = -n

poly3d-h:
	cd poly3d-h
	-$(MAKE) $(VIEW_ONLY) -fmakefile.djg install
	cd ..

poly3d-r:
	cd poly3d-r
	-$(MAKE) $(VIEW_ONLY) -fmakefile.djg install
	cd ..

illustrt:
	cd illustrt
	-$(MAKE) $(VIEW_ONLY) -fmakefile.djg install
	cd ..

misc_lib:
	cd misc_lib
	-$(MAKE) $(VIEW_ONLY) -fmakefile.djg install
	cd ..

cagd_lib:
	cd cagd_lib
	-$(MAKE) $(VIEW_ONLY) -fmakefile.djg install
	cd ..

prsr_lib:
	cd prsr_lib
	-$(MAKE) $(VIEW_ONLY) -fmakefile.djg install
	cd ..

geom_lib:
	cd geom_lib
	-$(MAKE) $(VIEW_ONLY) -fmakefile.djg install
	cd ..

grapdrvs:
	cd grapdrvs
	-$(MAKE) $(VIEW_ONLY) -fmakefile.djg install
	cd ..

irit:
	cd irit
	-$(MAKE) $(VIEW_ONLY) -fmakefile.djg install
	cd ..\docs
	-$(MAKE) $(VIEW_ONLY) -fmakefile.djg install
	cd ..

iritfltr:
	cd iritfltr
	-$(MAKE) $(VIEW_ONLY) -fmakefile.djg install
	cd ..


clean:
	-rm poly3d-h\*.map poly3d-h\*.bak poly3d-h\*.old poly3d-h\*.hdn poly3d-h\*.sym
	-rm poly3d-r\*.map poly3d-r\*.bak poly3d-r\*.old poly3d-r\*.gif poly3d-r\*.sym
	-rm illustrt\*.map illustrt\*.bak illustrt\*.old illustrt\*.gif illustrt\*.sym
	-rm iritfltr\*.map iritfltr\*.bak iritfltr\*.old iritfltr\*.sym
	-rm prsr_lib\*.map prsr_lib\*.bak prsr_lib\*.sym
	-rm geom_lib\*.map geom_lib\*.bak geom_lib\*.sym
	-rm cagd_lib\*.map cagd_lib\*.bak cagd_lib\*.sym
	-rm grapdrvs\*.map grapdrvs\*.bak grapdrvs\*.sym
	-rm misc_lib\*.map misc_lib\*.bak misc_lib\*.sym
	-rm irit\*.map irit\*.bak irit\*.old irit\*.sym irit\*.dat
	-rm docs\irithlp.exe

cleanobj:
	-rm poly3d-h\*.o poly3d-r\*.o illustrt\*.o irit\*.o
	-rm iritfltr\*.o cagd_lib\*.o misc_lib\*.o
	-rm prsr_lib\*.o geom_lib\*.o grapdrvs\*.o docs\*.o
	-rm docs\irithlp.exe

#
# Make hardcopy documentation.
#
docs:
	cd docs
	-$(MAKE) $(VIEW_ONLY) -fmakefile.djg irit.tex irit.doc
	cd ..

#
# Test some of the above programs. Make sure $(BIN_DIR) is in your path
#
test:
	cd irit
	-irit demo
	cd ..\poly3d-h
	-test-dos
	cd ..\poly3d-r
	-test-dos
	cd ..\illustrt
	-test-dos
	cd ..\iritfltr
	-test-dos
	cd ..
