# Main make targets for compiling with the gcc compiler.
#
# Only static linking is recommended.
#
# But when you insist, dynamic linking is possible when you issue
# make semidynamiclibs (see below).

all: allx

libs: staticlibs

include Config.tmpl

include Makefile.GEN

# note that libglobal.a is static because of template instances.
semidynamiclibs: libglobal.a libgui.so libeditor.so libdiagram.so libtable.so

tcm$(EXEEXTENSION):
	( cp ed/edinstances.h gl/instances.h )
	( cd ./gl ; touch llist.c )
	( $(MAKE) libglobal.a )
	( cd ./ed ; $(MAKE) $@)

tcmd$(EXEEXTENSION):
	( cp sd/sdinstances.h gl/instances.h )
	( cd ./gl ; touch llist.c )
	( $(MAKE) libglobal.a )
	( cd ./sd ; $(MAKE) $@)

tcmgd$(EXEEXTENSION) tcmtr$(EXEEXTENSION) tcmdv$(EXEEXTENSION) \
	tcmbv$(EXEEXTENSION) tgtt$(EXEEXTENSION) tfrt$(EXEEXTENSION) \
	tgd$(EXEEXTENSION) terd$(EXEEXTENSION) tesd$(EXEEXTENSION) \
	tcrd$(EXEEXTENSION) tssd$(EXEEXTENSION) tucd$(EXEEXTENSION) \
	tatd$(EXEEXTENSION) tstd$(EXEEXTENSION) tpsd$(EXEEXTENSION) \
	tsnd$(EXEEXTENSION) trpg$(EXEEXTENSION) tscd$(EXEEXTENSION) \
	tsqd$(EXEEXTENSION) tcbd$(EXEEXTENSION) tcpd$(EXEEXTENSION) \
	tdpd$(EXEEXTENSION):
	( cp dg/dginstances.h gl/instances.h )
	( cd ./gl ; touch llist.c )
	( $(MAKE) libglobal.a )
	( cd ./sd ; $(MAKE) $@)

tcmfv$(EXEEXTENSION) tdfd$(EXEEXTENSION) tefd$(EXEEXTENSION):
	( cp sd/fv/dfinstances.h gl/instances.h )
	( cd ./gl ; touch llist.c )
	( $(MAKE) libglobal.a )
	( cd ./sd ; $(MAKE) $@)

tcmt$(EXEEXTENSION) tgt$(EXEEXTENSION) ttdt$(EXEEXTENSION) ttut$(EXEEXTENSION) tfet$(EXEEXTENSION):
	( cp tb/tbinstances.h gl/instances.h )
	( cd ./gl ; touch llist.c )
	( $(MAKE) libglobal.a )
	( cd ./st ; $(MAKE) $@)

# csod:
# 	( cp cx/cx_instances.h gl/instances.h )
# 	( cd ./gl ; touch llist.c )
# 	( $(MAKE) libglobal.a )
# 	( cd ./cx ; $(MAKE) $@)

# ced:
# 	( cp dg/dginstances.h gl/instances.h )
# 	( cd ./gl ; touch llist.c )
# 	( $(MAKE) libglobal.a )
# 	( cd ./cx ; $(MAKE) $@)

# DO NOT DELETE THIS LINE -- make depend depends on it.
