##
##	$VER: LVDemo_Makefile 2.2 (14.9.97)
##
##	Copyright (C) 1996,97 by Bernardo Innocenti
##
##

###########################################################
# Name of the main executable
###########################################################
#
PROJ = LVDemo


###########################################################
# 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

# Cpu to compile for (eg: "68020").
#
CPU = 68000


###########################################################
# Object files in this project
###########################################################
#
OBJS = startup_sc.o LVDemo.o ListBoxClass.o ListViewHooks.o ListViewClass.o


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


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


###########################################################
# Compiler, linker and assembler flags
###########################################################
#

# Compiler flags for both release and debug versions
#
COMMON_CFLAGS = PARAMETERS=REGISTERS STRINGMERGE NOSTACKCHECK NOCHECKABORT \
	NOICONS NOVERSION ERRORREXX NOLINK DATA=NEAR CODE=NEAR STRSECT=CODE \
	GST $(PROJ).gst DEF=$(OSVER) CPU=$(CPU)

# Compiler optimization flags
#
OPT_CFLAGS = OPTIMIZE OPTTIME OPTSCHEDULER OPTINLINELOCAL \
	OPTRDEPTH=4 OPTDEPTH=4 OPTCOMP=8

# Debug flags: don't optimize and include all symbols in debug hunks
#
DEBUG_CFLAGS = NOOPTIMIZE DEBUG=FULLFLUSH ONERROR=CONTINUE DEF=DEBUG

# Use the utility.library for 32bit multiplication and division.
#
UTILLIB_LFLAGS = DEFINE __CXM33=__UCXM33 DEFINE __CXD33=__UCXD33 \
	DEFINE __CXM22=__UCXM22 DEFINE __CXD22=__UCXD22


# RELEASE version should be compiled with these flags
#
CFLAGS = $(COMMON_CFLAGS) $(OPT_CFLAGS)
LFLAGS = NODEBUG SMALLCODE SMALLDATA NOALVS NOICONS $(UTILLIB_LFLAGS)
LIBS = LIB LIB:sc.lib


# DEBUG version should be compiled with these flags
#
#CFLAGS = $(COMMON_CFLAGS) $(DEBUG_CFLAGS)
#LFLAGS = ADDSYM SMALLCODE SMALLDATA BATCH NOALVS NOICONS $(UTILLIB_LFLAGS)
#LIBS = LIB LIB:debug.lib LIB:sc.lib LIB:small.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.
#
# 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

ListViewClass.o: ListViewClass.c $(PROJ).gst
LVDemo.o: LVDemo.c $(PROJ).gst


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

$(PROJ): $(OBJS)
	$(LD) FROM $(OBJS) TO $(PROJ) $(LIBS) $(LFLAGS)
