  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  #                                                                     #
  #  SIMPLE MAKEFILE FOR OCPP,                                          #
  #  VALID MAKE TARGETS ARE:           ocpp.exe      -- DOS & TurboC    #
  #                                    ocpp          -- Unix & gcc      #
  #                                    dos_ocpp.btl  -- IMS D7314a or   #
  #                                    unx_ocpp.btl  -- SGS D7414a      #
  #                                                                     #
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

#{{{  -----  select an OS  -----

SW=/
RM=del
### Unix ###  SW=-
### Unix ###  RM=rm

#}}}  --------------------------

explain_about_valid_targets :
	more < makefile



# assuming TurboC, ie: That we have a somewhat non-standard INCLUDE path,
# an extern unsigned _stklen/*stack size*/ and can write a low_level
# function called stack_near_full(); I used C/C++ 1.0 (anchient!).

ocpp.exe : ocpp.c spawnc.lib
	tcc -mc -O -Z -G -d -f- -2 -DTC_STACK_SIZE=65535 ocpp.c spawnc.lib
	$(RM) ocpp.obj



# the following is untested, sorry... I'm informed gcc is pretty tolerant
# but I'd be interested to hear any useful porting tips, particularly if
# you use a tool like 'purify' which I don't have access to.

ocpp : ocpp.c
	gcc -O ocpp.c -o ocpp
	$(RM) ocpp.o



# The following are tested with the IMS_D7314a compiler; I have no access
# to SGS_D7413a to try it, but I *do* have SGS_D7405a occam so the linker
# and collector are tested. D7405a/icollect does not need the last $(RM)

dos_ocpp.btl : ocpp.c
	icc ocpp.c $(SW)ta $(SW)d__MSDOS__ $(SW)o ocpp.tco
	ilink ocpp.tco $(SW)ta $(SW)f cnonconf.lnk $(SW)o ocpp.lku
	icollect ocpp.lku $(SW)t $(SW)o dos_ocpp.btl
	$(RM) ocpp.tco
	$(RM) ocpp.lku
	$(RM) dos_ocpp.cfb

unx_ocpp.btl : ocpp.c
	icc ocpp.c $(SW)ta $(SW)o ocpp.tco
	ilink ocpp.tco $(SW)ta $(SW)f cnonconf.lnk $(SW)o ocpp.lku
	icollect ocpp.lku $(SW)t $(SW)o unx_ocpp.btl
	$(RM) ocpp.tco
	$(RM) ocpp.lku
	$(RM) unx_ocpp.cfb

