##
##	$VER: VectorGlyphDemo_Makefile 1.1 (25.9.97)
##
##	Copyright (C) 1997 by Bernardo Innocenti
##
##

###########################################################
# Name of the main executable and class library
###########################################################
#
PROJ = VectorGlyphDemo
CLASS = vectorglyph.image


###########################################################
# Package configuration
###########################################################
#
# set to OS30_ONLY to leave out support for old V37
# set to ANY_OS to make an executable for V37 with V39 support
#
OSVER = ANY_OS

# Class library version information
#
CLASSLIBVERSION		= 1
CLASSLIBREVISION	= 1


###########################################################
# Object files in this project
###########################################################
#
PROJOBJS = VectorGlyphDemo.o
CLASSOBJS = ClassLib.o VectorGlyphIClass.o


###########################################################
# Make the project
###########################################################
#
all: $(PROJ) $(CLASS)


###########################################################
# Remove all targets and intermediate files
###########################################################
#
clean:
	-Delete $(PROJ) $(CLASS) $(CLASSOBJS) $(PROJOBJS) $(PROJ).gst


###########################################################
# Compiler, linker and assembler flags
###########################################################
#
COMMON_CFLAGS = PARAMETERS=REGISTERS STRINGMERGE \
	NOSTACKCHECK NOCHECKABORT NOICONS NOVERSION ERRORREXX NOLINK \
	DATA=NEAR CODE=NEAR STRSECT=CODE GST $(PROJ).gst DEF=$(OSVER)

OPT_CFLAGS = OPTIMIZE OPTTIME OPTSCHEDULER OPTINLINELOCAL \
	OPTRDEPTH=4 OPTDEPTH=4 OPTCOMP=8

DEBUG_CFLAGS = NOOPTIMIZE DEBUG=FULLFLUSH DEF=DEBUG


# RELEASE version should be compiled with these flags
#
CFLAGS = $(COMMON_CFLAGS) $(OPT_CFLAGS)
LFLAGS = NODEBUG SMALLCODE SMALLDATA NOALVS NOICONS

# DEGUG version should be compiled with these flags
#
#CFLAGS = $(COMMON_CFLAGS) $(DEBUG_CFLAGS)
#LFLAGS = ADDSYM SMALLCODE SMALLDATA BATCH NOALVS NOICONS
#LIBS = LIB LIB:debug.lib


###########################################################
# Make Global Symbol Table to speed up compiling
###########################################################
#
# We must define some symbols here because defining them
# inside GST.c won't work as expected. (SAS/C bug?)
#
# NOTE:	The GST file does not depend on ListViewClass.h because
#	otherwise all objects would be remade whenever I edit
#	the header file.
#

$(PROJ).gst: GST.c
	$(CC) FROM GST.c MAKEGST $(PROJ).gst NOOBJNAME $(CFLAGS) \
	 DEF=INTUI_V36_NAMES_ONLY DEF=__USE_SYSBASE \
	 DEF=CLIB_ALIB_PROTOS_H DEF=LV_GADTOOLS_STUFF

VectorGlyphIClass.o: VectorGlyphIClass.c $(PROJ).gst
VectorGlyphDemo.o: VectorGlyphDemo.c $(PROJ).gst


###########################################################
# Make the executables
###########################################################
#
# NOTE: Using implicit make rule to compile C files:
#	.c.o:
#		$(CC) $(CFLAGS) $(*).c
#

# Assemble the class library init code
#
ClassLib.o: ClassLib.s
	PhxAss ClassLib.s TO $@ INCPATH=Include: NOEXE \
		SET "LIBVERSION=$(CLASSLIBVERSION),LIBREVISION=$(CLASSLIBREVISION)"

# Make the demo program
#
$(PROJ): $(PROJOBJS)
	$(LD) FROM $(PROJOBJS) TO $@ $(LIBS) $(LFLAGS)

# Make the class and make sure the old version is flushed away from memory
#
$(CLASS): $(CLASSOBJS)
	$(LD) FROM $(CLASSOBJS) TO $@ $(LIBS) $(LFLAGS)
	@Avail Flush >NIL:
