
PROJECT=VBR

# $(PROJECT).o _has_ to be the first module !!! (Because we use no
# startup-code)

OBJECTS=$(PROJECT).o $(PROJECT)_asm.o
HEADERS=$(PROJECT).h

#DEBUG=DEFINE DEBUG=1           #This line for debugging
DEBUG=#DEFINE DEBUG=1           #This line for final version

$(PROJECT).stripped: $(PROJECT)

# "$(PROJECT)" is the debuggable version of the program.  The same
# link step will generate a map file due to the various MAP options
# in the SCOPTIONS file.

$(PROJECT): $(PROJECT).gst $(OBJECTS)
   SC LINK $(OBJECTS) TO $(PROJECT)

# "$(PROJECT).stripped" is the stripped version of the program.  It
# will load faster if you aren't debugging it, but the map file is
# still valid for it in case you get enforcer hits.

$(PROJECT).stripped: $(PROJECT)
   SLINK $(PROJECT) TO $(PROJECT).stripped NODEBUG NOICONS

# Generic compile command
.c.o:
   sc $(DEBUG) noicons $<

.s.o:
   sc $(DEBUG) noicons CPU=68010 $<

# Build the GST.  We use a normal project .c file to compile, but
# the GST actually depends on the .h files in the project, not the
# .c file.   The NOOBJNAME option prevents the compiler from trying
# to generate code.

$(PROJECT).gst: $(HEADERS)
   SC MAKEGST $(PROJECT).gst $(PROJECT).c NOOBJNAME

# Rules for each .o file
$(PROJECT).o: $(PROJECT).c
$(PROJECT)_asm.o: $(PROJECT)_asm.s $(PROJECT)_asm.i

# Special cleanup target.  Build this to clear out the whole thing.
# Note the backslash to escape the # in the commands below.  This
# is needed since # is a comment character by itself.
# If you build from workbench, make this into a seperate build
# script; this way you can click on BUILD, then shift-double-click
# on the script and clean up your project.
clean:
   gst unload $(PROJECT).gst
   delete \#?.o \#?.stripped \#?.gst \#?.map $(PROJECT) quiet
