# makefile for vbcc
# fairly standard stuff used, you should be able to easily modify it
# for use with other compilers


# Some defintions for when compiling and linking. Read the manual for "make"
# or study the rest of this makefile for more information.
# These should be changed to reflect the compiler you have on your system.
CC      = vc
CFLAGS  = -c -+ -sc -O2 -Iinclude: -D__VBCC__
CCFLAGS =
LD      = vc
LDFLAGS = -nostdlib
LDLIBS  = -lamiga


# The default target (all) and what to really build
all: ppc_processor.plugin


# List of all the object files that go together to make up the final executable
# Make sure that startup.o is first in the list as this contains our own startup
# code (which must be used, as we link without startup code for shared objects)
OBJS    = startup.o libinit.o semaphores.o libfuncs.o


# CLI command used when linking the final executable
ppc_processor.plugin: $(OBJS)
	$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)


# CLI command used when compiling. This is generic and will be called for all the
# dependancies that need compiling.
.c.o:
	$(CC) $(CCFLAGS) $(CFLAGS) -o $@ $<


# A list of all project dependancies. Since the list of header files is so small, they
# are just put in after the source files instead of defining another variable to hold them
# all.
startup.o: startup.c defs.h libbase.h libfuncs.h libinit.h semaphores.h
libinit.o: libinit.c defs.h semaphores.h libinit.h
semaphores.o: semaphores.c
libfuncs.o: libfuncs.c defs.h


# A little something to clean it all up
clean:
	delete #?.o

