2000-05-28 13:40:48 +00:00
|
|
|
#
|
|
|
|
# makefile for CC65 runtime library
|
|
|
|
#
|
|
|
|
|
|
|
|
.SUFFIXES: .o .obj .s .c
|
|
|
|
|
2001-03-13 07:56:56 +00:00
|
|
|
# Defines for executables. The first two are passed to the submakes and are
|
|
|
|
# relative to the subdirectories, the last one is used directly.
|
|
|
|
CC = ../../src/cc65/cc65
|
|
|
|
AS = ../../src/ca65/ca65
|
2000-05-28 13:40:48 +00:00
|
|
|
AR = ../src/ar65/ar65
|
|
|
|
|
2000-10-10 19:54:45 +00:00
|
|
|
# List of all targets
|
|
|
|
ALLTARGETS = apple2lib \
|
2002-06-03 20:23:15 +00:00
|
|
|
atarilib \
|
|
|
|
atmoslib \
|
|
|
|
c64lib \
|
|
|
|
c128lib \
|
2001-09-13 21:47:10 +00:00
|
|
|
cbm510lib \
|
2000-10-10 19:54:45 +00:00
|
|
|
cbm610lib \
|
2002-06-03 20:23:15 +00:00
|
|
|
geoslib \
|
|
|
|
petlib \
|
2000-10-10 19:54:45 +00:00
|
|
|
plus4lib
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
2000-10-10 19:54:45 +00:00
|
|
|
all:
|
|
|
|
for tgt in $(ALLTARGETS); do \
|
2001-11-05 22:29:47 +00:00
|
|
|
$(MAKE) clean $$tgt || exit 1; \
|
2000-10-10 19:54:45 +00:00
|
|
|
done
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Apple ][
|
|
|
|
|
|
|
|
apple2lib:
|
2000-11-23 12:42:39 +00:00
|
|
|
for i in apple2 common runtime conio dbg; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
2001-09-18 12:22:55 +00:00
|
|
|
CFLAGS="-Osir -g -T -t apple2 -I../../include" \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t apple2 -I../../asminc" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
done
|
2000-05-28 13:40:48 +00:00
|
|
|
mv apple2/crt0.o apple2.o
|
|
|
|
for i in apple2 common runtime conio dbg; do \
|
|
|
|
$(AR) a apple2.lib $$i/*.o;\
|
|
|
|
done
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Atari
|
|
|
|
|
|
|
|
atarilib:
|
2000-11-23 12:42:39 +00:00
|
|
|
for i in atari common runtime conio dbg; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
2001-11-05 22:29:47 +00:00
|
|
|
CFLAGS="-Osir -g -T -t atari -I../../include" \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t atari -I../../asminc" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
done
|
2000-05-28 13:40:48 +00:00
|
|
|
mv atari/crt0.o atari.o
|
|
|
|
for i in atari common runtime conio dbg; do \
|
|
|
|
$(AR) a atari.lib $$i/*.o;\
|
|
|
|
done
|
|
|
|
|
2002-06-03 20:23:15 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Oric Atmos
|
|
|
|
|
|
|
|
atmoslib:
|
|
|
|
for i in atmos common runtime; do \
|
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
|
|
|
CFLAGS="-Osir -g -T -t atmos -I../../include" \
|
|
|
|
AFLAGS="-t atmos -I../../asminc" \
|
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
done
|
|
|
|
mv atmos/crt0.o atmos.o
|
|
|
|
for i in atmos common runtime; do \
|
|
|
|
$(AR) a atmos.lib $$i/*.o;\
|
|
|
|
done
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# C64
|
|
|
|
|
|
|
|
c64lib:
|
2002-06-21 16:25:56 +00:00
|
|
|
for i in c64 cbm common runtime conio dbg tgi; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
2001-11-05 22:29:47 +00:00
|
|
|
CFLAGS="-Osir -g -T -t c64 -I../../include" \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t c64 -I../../asminc" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
done
|
2000-05-28 13:40:48 +00:00
|
|
|
mv c64/crt0.o c64.o
|
2002-06-21 16:25:56 +00:00
|
|
|
for i in c64 cbm common runtime conio dbg tgi; do \
|
2000-05-28 13:40:48 +00:00
|
|
|
$(AR) a c64.lib $$i/*.o;\
|
|
|
|
done
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# C128
|
|
|
|
|
|
|
|
c128lib:
|
2000-11-23 12:42:39 +00:00
|
|
|
for i in c128 cbm common runtime conio dbg; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
2001-09-18 12:22:55 +00:00
|
|
|
CFLAGS="-Osir -g -T -t c128 -I../../include" \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t c128 -I../../asminc" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
done
|
2000-05-28 13:40:48 +00:00
|
|
|
mv c128/crt0.o c128.o
|
|
|
|
for i in c128 cbm common runtime conio dbg; do \
|
|
|
|
$(AR) a c128.lib $$i/*.o;\
|
|
|
|
done
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
2001-09-18 12:22:55 +00:00
|
|
|
# Commdore P500 / CBM 5x0
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2001-09-18 12:22:55 +00:00
|
|
|
cbm510lib:
|
|
|
|
for i in cbm510 cbm common runtime conio dbg; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
2001-09-18 12:22:55 +00:00
|
|
|
CFLAGS="-Osir -g -T -t cbm510 -I../../include" \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t cbm510 -I../../asminc" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
done
|
2001-09-18 12:22:55 +00:00
|
|
|
mv cbm510/crt0.o cbm510.o
|
|
|
|
for i in cbm510 cbm common runtime conio dbg; do \
|
|
|
|
$(AR) a cbm510.lib $$i/*.o;\
|
2000-05-28 13:40:48 +00:00
|
|
|
done
|
|
|
|
|
2001-09-13 21:47:10 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
2001-09-18 12:22:55 +00:00
|
|
|
# PET-II series
|
2001-09-13 21:47:10 +00:00
|
|
|
|
2001-09-18 12:22:55 +00:00
|
|
|
cbm610lib:
|
|
|
|
for i in cbm610 cbm common runtime conio dbg; do \
|
2001-09-13 21:47:10 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
2001-09-18 12:22:55 +00:00
|
|
|
CFLAGS="-Osir -g -T -t cbm610 -I../../include" \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t cbm610 -I../../asminc" \
|
2001-09-13 21:47:10 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
done
|
2001-09-18 12:22:55 +00:00
|
|
|
mv cbm610/crt0.o cbm610.o
|
|
|
|
for i in cbm610 cbm common runtime conio dbg; do \
|
|
|
|
$(AR) a cbm610.lib $$i/*.o;\
|
2001-09-13 21:47:10 +00:00
|
|
|
done
|
2001-09-14 21:11:39 +00:00
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# GEOS on the C64/128
|
|
|
|
|
|
|
|
geoslib:
|
2001-08-15 16:09:35 +00:00
|
|
|
CC=../$(CC) \
|
2001-07-14 14:41:30 +00:00
|
|
|
AS=../$(AS) \
|
|
|
|
AR=../$(AR) \
|
2001-10-20 20:28:28 +00:00
|
|
|
CFLAGS="-Osir -g -T -t geos -I../../../include" \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t geos -I../../../asminc" \
|
2001-07-14 14:41:30 +00:00
|
|
|
$(MAKE) -C geos || exit 1
|
|
|
|
for i in common runtime; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
2001-07-03 20:24:28 +00:00
|
|
|
AR=$(AR) \
|
2001-09-18 12:22:55 +00:00
|
|
|
CFLAGS="-Osir -g -T -t geos -I../../include" \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t geos -I../../asminc" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
done
|
2000-05-28 13:40:48 +00:00
|
|
|
for i in common runtime; do \
|
2001-07-14 14:55:08 +00:00
|
|
|
for objfile in $$i/*.o; do \
|
|
|
|
if [ -f geos/$$objfile ]; then \
|
|
|
|
$(AR) a geos.lib geos/$$objfile; \
|
|
|
|
else \
|
|
|
|
$(AR) a geos.lib $$objfile; \
|
|
|
|
fi; \
|
|
|
|
done \
|
2000-05-28 13:40:48 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# CBM PET machines
|
|
|
|
|
|
|
|
petlib:
|
2000-11-23 12:42:39 +00:00
|
|
|
for i in pet cbm common runtime conio dbg; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
2001-09-18 12:22:55 +00:00
|
|
|
CFLAGS="-Osir -g -T -t pet -I../../include" \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t pet -I../../asminc" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
done
|
2000-05-28 13:40:48 +00:00
|
|
|
mv pet/crt0.o pet.o
|
|
|
|
for i in pet cbm common runtime conio dbg; do \
|
|
|
|
$(AR) a pet.lib $$i/*.o;\
|
|
|
|
done
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Commodore C116, C16 and Plus/4
|
|
|
|
|
|
|
|
plus4lib:
|
2000-11-23 12:42:39 +00:00
|
|
|
for i in plus4 cbm common runtime conio dbg; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
2001-09-18 12:22:55 +00:00
|
|
|
CFLAGS="-Osir -g -T -t plus4 -I../../include" \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t plus4 -I../../asminc" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
done
|
2000-05-28 13:40:48 +00:00
|
|
|
mv plus4/crt0.o plus4.o
|
|
|
|
for i in plus4 cbm common runtime conio dbg; do \
|
|
|
|
$(AR) a plus4.lib $$i/*.o;\
|
|
|
|
done
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Dummy targets
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2002-06-22 10:58:47 +00:00
|
|
|
@for i in apple2 atari c128 c64 cbm cbm510 cbm610 common conio dbg geos pet plus4 runtime tgi; do \
|
2001-11-05 22:29:47 +00:00
|
|
|
$(MAKE) -C $$i clean; \
|
2000-05-28 13:40:48 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
.PHONY: zap
|
|
|
|
zap: clean
|
2001-11-05 22:29:47 +00:00
|
|
|
@rm -f *.o *.lib
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-03-13 07:56:56 +00:00
|
|
|
|
2002-04-21 14:19:16 +00:00
|
|
|
|