\hush\examples\sim\makefile.mak
Simulation library exmaples make file
Put the macro definition "ASCII=1" here to compile the ascii versions
If TARGETNAME is defined only that target will be build, otherwise all SIM examples will be build
!ifndef TARGETNAME
all: sim_examples
!ifdef ASCII
!message *** sim ascii version ***
!else
!message *** sim hush-gui version ***
!endif
!else
all: one_sim
!endif
Settings of target platform and location of object files
!ifdef ASCII
DOS16=1
OBJDIR=asciiobj
!else
WIN32=1
OBJDIR=guiobj
!endif
Global definitions
!include ..\resource.mak
Which library to use:
!ifdef ASCII
SIMLIB=$(LIBDIR)\asciisim.lib
!else
SIMLIB=$(LIBDIR)\guisim.lib
!endif
Main target: build all examples
sim_examples :
build airport-
build airport
build altbit-e
build altbit
build bank-ev
build bank
build csma-cd
build harbour-
build harbour
build jobshop
build philosop
build postoffi
build reliabil
build tankstat
build philo-ev
build philo-sc
How to build just one example:
one_sim: $(CONFIG) $(TARGETNAME).exe
How to do cleanup
clean: $(RM) $(RMTREE)
$(RM) *.exe
$(RM) *.obj
$(RM) *.cfg
$(RM) *.out
$(RMTREE) asciiobj
$(RMTREE) guiobj
$(RM) $(RMTREE)
del $(RM)
cleanconfig: $(RM)
$(RM) *.cfg
Compiling and linking flags:
$(CONFIG): $(MKDIR)
$(MKDIR) $(OBJDIR)
del $(MKDIR)
copy &&|
-n$(OBJDIR)
-I$(INCLUDES)
-D$(DEFINES)
$(CCFLAGS)
| $(CONFIG) > nul
If TARGETNAME has been defined, this will tell how to build the executable.
!ifdef TARGETNAME
$(TARGETNAME).exe: $(TARGETNAME).obj
$(LINK) @&&|
$(LNFLAGS) $(OBJDIR)\$(TARGETNAME).obj
$@
-x
$(LNLIBS) $(SIMLIB)
!ifdef ASCII
|
!else
|, &&|
EXETYPE WINDOWS
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD MOVEABLE MULTIPLE
|, $(LIBDIR)\hush.res
!endif
!endif
Implicit rules:
.c.obj:
$(CC) { $< }
Location of object files:
.path.obj = $(OBJDIR)