#
# Makefile for utils
# for use with a unix hosted gcc based cross development system
#
# - adjust CROSSDIR below for your setup
# - define GCC to be the path to your hosts C compiler (gcc preferred)
# - If you are going to run the cross linker on a machine that aligns structures
#   at longword boundaries (machines such as Sun-Sparc, Convex etc) add
#   -DWORD_ALIGNED to CFLAGS
# - If you are going to run the cross linker on a machine that has the opposite
#    byte sex to a m68k, ie a little endian host, the add -DBYTE_SWAP to CFLAGS.
#
CROSSDIR = /net/acae127/home/bammi/atari/cross-minix
CROSSBIN = $(CROSSDIR)/bin
CROSSLIB = $(CROSSDIR)/lib
CROSSINC = $(CROSSDIR)/include

# Host GCC
CC = cc
# Host include dir
HOSTINC = /usr/include

CFLAGS = -O -g -I. -I$(HOSTINC) -I$(CROSSINC) -DCROSSATARI=1 -DMINIX=1\
-DCROSSDIR=\"$(CROSSDIR)\" -DCROSSLIB=\"$(CROSSLIB)\" -DWORD_ALIGNED=1
# define if on an a 32 bit alignment host
# -DWORD_ALIGNED

all: ld

#
# the 'regular' linker, produces atari executables
#
ld : ld.o cplusdem.o
	$(CC) -o ld ld.o cplusdem.o

install: ld 
	cp ld $(CROSSLIB)/gcc-ld

clean:
	rm -f *.o core
