##
##	$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
OSVER = OS30_ONLY

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

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


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


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


###########################################################
# Compiler, linker and assembler flags
###########################################################
#
# Note: Using the "STRINGSCONST" compiler option requires
#       patched versions of the OS headers to work correctly
#

# 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 STRINGSCONST 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 CODE=FAR

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

###########################################################
# 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): $(PROJ).gst $(OBJS)
	$(LD) FROM $(OBJS) TO $(PROJ) $(LIBS) $(LFLAGS)


###########################################################
# Dependencies
###########################################################
#
ListViewClass.o:		ListViewClass.c
ListBoxClass.o:			ListBoxClass.c
ScrollButtonClass.o:	ScrollButtonClass.c
LVDemo.o:				LVDemo.c
