CC = vc +warpos
COPTS = -c
CONFIG = -DHAVE_CONFIG -DTYPES32BIT \
         -DBIGENDIAN -DAMIGAOS -DFASTALLOC \
         -DADOS -DEHF -DELF32_PPC_BE -DELF32_POWERUP
CLIBS = -lamiga
DIR = AmigaWarpOS

vlinkobjects = $(DIR)/main.o $(DIR)/support.o $(DIR)/errors.o \
               $(DIR)/linker.o $(DIR)/dir.o $(DIR)/relocnames.o \
               $(DIR)/targets.o $(DIR)/t_amigaos.o \
               $(DIR)/t_elf32.o $(DIR)/t_elf64.o

vlinkWOS: $(vlinkobjects)
	$(CC) -o $(DIR)/version.o $(COPTS) $(CONFIG) version.c
	$(CC) -o vlinkWOS $(vlinkobjects) $(DIR)/version.o $(CLIBS)


$(DIR)/main.o: main.c vlink.h config.h ar.h
	$(CC) -o $@ $(COPTS) $(CONFIG) main.c

$(DIR)/support.o: support.c vlink.h config.h ar.h
	$(CC) -o $@ $(COPTS) $(CONFIG) support.c

$(DIR)/errors.o: errors.c vlink.h config.h ar.h
	$(CC) -o $@ $(COPTS) $(CONFIG) errors.c

$(DIR)/linker.o: linker.c vlink.h config.h ar.h
	$(CC) -o $@ $(COPTS) $(CONFIG) linker.c

$(DIR)/dir.o: dir.c vlink.h config.h ar.h
	$(CC) -o $@ $(COPTS) $(CONFIG) dir.c

$(DIR)/relocnames.o: relocnames.c
	$(CC) -o $@ $(COPTS) $(CONFIG) relocnames.c

$(DIR)/targets.o: targets.c vlink.h config.h ar.h
	$(CC) -o $@ $(COPTS) $(CONFIG) targets.c

$(DIR)/t_amigaos.o: t_amigaos.c vlink.h config.h ar.h amigahunks.h
	$(CC) -o $@ $(COPTS) $(CONFIG) t_amigaos.c

$(DIR)/t_elf32.o: t_elf32.c vlink.h config.h ar.h elf32.h elfcommon.h
	$(CC) -o $@ $(COPTS) $(CONFIG) t_elf32.c

$(DIR)/t_elf64.o: t_elf64.c vlink.h config.h ar.h elf64.h elfcommon.h
	$(CC) -o $@ $(COPTS) $(CONFIG) t_elf64.c
