#
# This make file is the main make file of the IRIT solid modeller and its
# auxilary tools.
#
# Do the following before run make:
#
# 1. Edit 'makeflag.dos' for the exact path names to ne used for libraries and
#    binaries. Also set the C compiler and linker flags.
# 2. Make sure lib_gifl.lib for MSDOS from the lib subdirectory is in the same
#    place as LIB_DIR as set in dirs.dos and that lib_gif.h from the inc
#    subdirectory is in the same place as INC_DIR as set in dirs.dos. This
#    library is provided compiled in large model only. See documentation
#    on how to get its sources.
#
# 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.tc"

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 command:

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.tc install
	cd ..

poly3d-r:
	cd poly3d-r
	-make $(VIEW_ONLY) -fmakefile.tc install
	cd ..

illustrt:
	cd illustrt
	-make $(VIEW_ONLY) -fmakefile.tc install
	cd ..

misc_lib:
	cd misc_lib
	-make $(VIEW_ONLY) -fmakefile.tc install
	cd ..

prsr_lib:
	cd prsr_lib
	-make $(VIEW_ONLY) -fmakefile.tc install
	cd ..

geom_lib:
	cd geom_lib
	-make $(VIEW_ONLY) -fmakefile.tc install
	cd ..

grapdrvs:
	cd grapdrvs
	-make $(VIEW_ONLY) -fmakefile.tc install
	cd ..

cagd_lib:
	cd cagd_lib
	-make $(VIEW_ONLY) -fmakefile.tc install
	cd ..

irit:
	cd irit
	-make $(VIEW_ONLY) -fmakefile.tc install
	cd ..\docs
	-make $(VIEW_ONLY) -fmakefile.tc install
	cd ..

iritfltr:
	cd iritfltr
	-make $(VIEW_ONLY) -fmakefile.tc 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\*.sym
	-rm iritfltr\*.map iritfltr\*.bak iritfltr\*.old iritfltr\*.sym
	-rm cagd_lib\*.map cagd_lib\*.bak cagd_lib\*.sym
	-rm prsr_lib\*.map prsr_lib\*.bak prsr_lib\*.sym
	-rm geom_lib\*.map geom_lib\*.bak geom_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\*.obj poly3d-r\*.obj illustrt\*.obj \
	    irit\*.obj iritfltr\*.obj cagd_lib\*.obj misc_lib\*.obj \
	    grapdrvs\*.obj prsr_lib\*.obj geom_lib\*.obj docs\*.obj
	-rm docs\irithlp.exe

#
# Make hardcopy documentation.
#
docs:
	cd docs
	-make $(VIEW_ONLY) -f makefile.tc 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 ..

#
# Generate dependencies for the source tree.
#
depend:
	cd irit
	-makedpnd -u -r -m makefile.unx *.c
	-makedpnd -u -r -m makefile.os2 *.c
	-makedpnd    -r -m makefile.tc *.c
	cd ..\poly3d-h
	-makedpnd -u -r -m makefile.unx *.c
	-makedpnd -u -r -m makefile.os2 *.c
	-makedpnd -u -r -m makefile.djg *.c
	-makedpnd    -r -m makefile.tc *.c
	cd ..\poly3d-r
	-makedpnd -u -r -m makefile.unx *.c
	-makedpnd -u -r -m makefile.os2 *.c
	-makedpnd -u -r -m makefile.djg *.c
	-makedpnd    -r -m makefile.tc *.c
	cd ..\illustrt
	-makedpnd -u -r -m makefile.unx *.c
	-makedpnd -u -r -m makefile.os2 *.c
	-makedpnd -u -r -m makefile.djg *.c
	-makedpnd    -r -m makefile.tc *.c
	cd ..\iritfltr
	-makedpnd -u -r -m makefile.unx *.c
	-makedpnd -u -r -m makefile.os2 *.c
	-makedpnd -u -r -m makefile.djg *.c
	-makedpnd    -r -m makefile.tc *.c
	cd ..\cagd_lib
	-makedpnd -u -r -m makefile.unx *.c
	-makedpnd -u -r -m makefile.os2 *.c
	-makedpnd -u -r -m makefile.djg *.c
	-makedpnd    -r -m makefile.tc *.c
	cd ..\misc_lib
	-makedpnd -u -r -m makefile.unx *.c
	-makedpnd -u -r -m makefile.os2 *.c
	-makedpnd -u -r -m makefile.djg *.c
	-makedpnd    -r -m makefile.tc *.c
	cd ..\prsr_lib
	-makedpnd -u -r -m makefile.unx *.c
	-makedpnd -u -r -m makefile.os2 *.c
	-makedpnd -u -r -m makefile.djg *.c
	-makedpnd    -r -m makefile.tc *.c
	cd ..\geom_lib
	-makedpnd -u -r -m makefile.unx *.c
	-makedpnd -u -r -m makefile.os2 *.c
	-makedpnd -u -r -m makefile.djg *.c
	-makedpnd    -r -m makefile.tc *.c
	cd ..\grapdrvs
	-makedpnd -u -r -m makefile.unx *.c
	-makedpnd -u -r -m makefile.os2 *.c
	-makedpnd -u -r -m makefile.djg *.c
	-makedpnd    -r -m makefile.tc *.c
	cd ..

