2000-05-28 13:40:48 +00:00
|
|
|
#
|
|
|
|
# makefile for CC65 runtime library
|
|
|
|
#
|
|
|
|
|
|
|
|
.SUFFIXES: .o .obj .s .c
|
|
|
|
|
2002-08-07 19:28:39 +00:00
|
|
|
# Defines for executables. AR is used within this makefile, the others are
|
|
|
|
# passed to the submakes and contain paths relative to the subdirectories
|
|
|
|
# handled by the make subprocesses.
|
2000-05-28 13:40:48 +00:00
|
|
|
AR = ../src/ar65/ar65
|
2002-08-07 19:28:39 +00:00
|
|
|
AS = ../../src/ca65/ca65
|
2002-07-07 11:12:16 +00:00
|
|
|
CC = ../../src/cc65/cc65
|
|
|
|
LD = ../../src/ld65/ld65
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2000-10-10 19:54:45 +00:00
|
|
|
# List of all targets
|
2003-10-10 16:44:20 +00:00
|
|
|
ALLTARGETS = apple2 \
|
|
|
|
atari \
|
|
|
|
atmos \
|
|
|
|
c16 \
|
|
|
|
c128 \
|
|
|
|
c64 \
|
|
|
|
cbm510 \
|
|
|
|
cbm610 \
|
|
|
|
geos \
|
|
|
|
nes \
|
|
|
|
pet \
|
|
|
|
plus4 \
|
|
|
|
supervision \
|
|
|
|
vic20
|
2000-10-10 19:54:45 +00:00
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
2003-02-06 15:35:30 +00:00
|
|
|
.PHONY: all
|
2000-10-10 19:54:45 +00:00
|
|
|
all:
|
|
|
|
for tgt in $(ALLTARGETS); do \
|
2002-11-29 14:42:12 +00:00
|
|
|
$(MAKE) clean "$$tgt"lib || exit 1; \
|
2000-10-10 19:54:45 +00:00
|
|
|
done
|
2002-07-07 11:17:27 +00:00
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Apple ][
|
2002-08-08 12:16:52 +00:00
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
apple2lib:
|
2003-10-01 20:59:06 +00:00
|
|
|
for i in apple2 common runtime conio dbg em joystick tgi zlib; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
AS=$(AS) \
|
2002-12-02 06:10:41 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
LD=$(LD) \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t apple2 -I../../asminc" \
|
2003-08-03 12:04:59 +00:00
|
|
|
CFLAGS="-Osir -g -T -t apple2 --forget-inc-paths -I. -I../../include" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
2000-05-28 13:40:48 +00:00
|
|
|
$(AR) a apple2.lib $$i/*.o;\
|
|
|
|
done
|
2002-11-29 14:42:12 +00:00
|
|
|
mv apple2/crt0.o apple2.o
|
2003-12-09 20:46:38 +00:00
|
|
|
cp apple2/apple2-280-192-6.tgi apple2.hi.tgi
|
|
|
|
cp apple2/apple2-40-40-16.tgi apple2.lo.tgi
|
2003-05-02 11:53:21 +00:00
|
|
|
cp apple2/apple2-stdjoy.joy a2-stdjoy.joy
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Atari
|
|
|
|
|
|
|
|
atarilib:
|
2003-10-01 20:59:06 +00:00
|
|
|
for i in atari common runtime conio dbg em joystick tgi zlib; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
AS=$(AS) \
|
2002-12-02 06:10:41 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
LD=$(LD) \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t atari -I../../asminc" \
|
2003-08-03 12:04:59 +00:00
|
|
|
CFLAGS="-Osir -g -T -t atari --forget-inc-paths -I. -I../../include" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
2000-05-28 13:40:48 +00:00
|
|
|
$(AR) a atari.lib $$i/*.o;\
|
|
|
|
done
|
2002-11-29 14:42:12 +00:00
|
|
|
mv atari/crt0.o atari.o
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2002-06-03 20:23:15 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Oric Atmos
|
|
|
|
|
|
|
|
atmoslib:
|
2003-10-01 20:59:06 +00:00
|
|
|
for i in atmos common conio runtime em joystick tgi zlib; do \
|
2002-06-03 20:23:15 +00:00
|
|
|
AS=$(AS) \
|
2002-12-02 06:10:41 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
LD=$(LD) \
|
2002-11-06 21:58:00 +00:00
|
|
|
AFLAGS="-t atmos -I../../asminc" \
|
2003-08-03 12:04:59 +00:00
|
|
|
CFLAGS="-Osir -g -T -t atmos --forget-inc-paths -I. -I../../include" \
|
2002-06-03 20:23:15 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
$(AR) a atmos.lib $$i/*.o;\
|
|
|
|
done
|
2002-11-29 14:42:12 +00:00
|
|
|
mv atmos/crt0.o atmos.o
|
2002-06-03 20:23:15 +00:00
|
|
|
|
2002-11-21 21:22:26 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# C16, C116
|
|
|
|
|
|
|
|
c16lib:
|
2003-10-01 20:59:06 +00:00
|
|
|
for i in c16 cbm common runtime conio dbg em joystick tgi zlib; do \
|
2002-11-21 21:22:26 +00:00
|
|
|
AS=$(AS) \
|
2002-12-02 06:10:41 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
LD=$(LD) \
|
2002-11-22 00:53:10 +00:00
|
|
|
AFLAGS="-t c16 -I../../asminc" \
|
2003-08-03 12:04:59 +00:00
|
|
|
CFLAGS="-Osir -g -T -t c16 --forget-inc-paths -I. -I../../include" \
|
2002-11-21 21:22:26 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
$(AR) a c16.lib $$i/*.o;\
|
|
|
|
done
|
2002-11-29 14:42:12 +00:00
|
|
|
mv c16/crt0.o c16.o
|
2002-12-21 09:10:15 +00:00
|
|
|
cp c16/*.joy .
|
2002-11-22 00:53:10 +00:00
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# C64
|
|
|
|
|
|
|
|
c64lib:
|
2003-10-01 20:59:06 +00:00
|
|
|
for i in c64 cbm common runtime conio dbg em joystick serial tgi zlib; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
AS=$(AS) \
|
2002-07-07 11:12:16 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
LD=$(LD) \
|
2002-12-02 06:10:41 +00:00
|
|
|
AFLAGS="-t c64 -I../../asminc" \
|
2003-08-03 12:04:59 +00:00
|
|
|
CFLAGS="-Osir -g -T -t c64 --forget-inc-paths -I. -I../../include" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
2002-11-29 14:42:12 +00:00
|
|
|
$(AR) a c64.lib $$i/*.o;\
|
2000-11-23 12:42:39 +00:00
|
|
|
done
|
2002-08-07 19:28:39 +00:00
|
|
|
mv c64/crt0.o c64.o
|
2002-12-02 21:28:35 +00:00
|
|
|
cp c64/*.emd .
|
2002-12-20 21:41:40 +00:00
|
|
|
cp c64/*.joy .
|
2003-08-15 21:17:36 +00:00
|
|
|
cp c64/*.ser .
|
2002-12-20 21:41:40 +00:00
|
|
|
cp c64/c64-320-200-2.tgi c64-hi.tgi
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# C128
|
|
|
|
|
|
|
|
c128lib:
|
2003-10-01 20:59:06 +00:00
|
|
|
for i in c128 cbm common runtime conio dbg em joystick tgi zlib; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
AS=$(AS) \
|
2002-12-02 06:10:41 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
LD=$(LD) \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t c128 -I../../asminc" \
|
2003-08-03 12:04:59 +00:00
|
|
|
CFLAGS="-Osir -g -T -t c128 --forget-inc-paths -I. -I../../include" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
2000-05-28 13:40:48 +00:00
|
|
|
$(AR) a c128.lib $$i/*.o;\
|
|
|
|
done
|
2002-11-29 14:42:12 +00:00
|
|
|
mv c128/crt0.o c128.o
|
2002-12-02 21:28:35 +00:00
|
|
|
cp c128/*.emd .
|
2002-12-20 23:30:14 +00:00
|
|
|
cp c128/*.joy .
|
2002-12-22 23:29:11 +00:00
|
|
|
cp c128/c128-640-200-2.tgi c128-vdc.tgi
|
2002-12-23 14:15:46 +00:00
|
|
|
cp c128/c128-640-480-2.tgi c128-vdc2.tgi
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
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:
|
2003-10-01 20:59:06 +00:00
|
|
|
for i in cbm510 cbm common runtime conio dbg em joystick tgi zlib; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
2002-12-02 06:10:41 +00:00
|
|
|
LD=$(LD) \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t cbm510 -I../../asminc" \
|
2003-08-03 12:04:59 +00:00
|
|
|
CFLAGS="-Osir -g -T -t cbm510 --forget-inc-paths -I. -I../../include" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
2001-09-18 12:22:55 +00:00
|
|
|
$(AR) a cbm510.lib $$i/*.o;\
|
2000-05-28 13:40:48 +00:00
|
|
|
done
|
2002-11-29 14:42:12 +00:00
|
|
|
mv cbm510/crt0.o cbm510.o
|
2002-12-10 10:30:01 +00:00
|
|
|
cp cbm510/*.emd .
|
2003-02-16 14:43:18 +00:00
|
|
|
cp cbm510/*.joy .
|
2000-05-28 13:40:48 +00:00
|
|
|
|
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:
|
2003-10-01 20:59:06 +00:00
|
|
|
for i in cbm610 cbm common runtime conio dbg em joystick tgi zlib; do \
|
2003-04-14 21:28:51 +00:00
|
|
|
CC=$(CC) \
|
2001-09-13 21:47:10 +00:00
|
|
|
AS=$(AS) \
|
2002-12-02 06:10:41 +00:00
|
|
|
LD=$(LD) \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t cbm610 -I../../asminc" \
|
2003-08-03 12:04:59 +00:00
|
|
|
CFLAGS="-Osir -g -T -t cbm610 --forget-inc-paths -I. -I../../include" \
|
2001-09-13 21:47:10 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
2001-09-18 12:22:55 +00:00
|
|
|
$(AR) a cbm610.lib $$i/*.o;\
|
2001-09-13 21:47:10 +00:00
|
|
|
done
|
2002-11-29 14:42:12 +00:00
|
|
|
mv cbm610/crt0.o cbm610.o
|
2002-12-10 10:30:01 +00:00
|
|
|
cp cbm610/*.emd .
|
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) \
|
2002-12-02 06:10:41 +00:00
|
|
|
LD=../$(LD) \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t geos -I../../../asminc" \
|
2003-08-03 12:04:59 +00:00
|
|
|
CFLAGS="-Osir -g -T -t geos --forget-inc-paths -I. -I../../../include" \
|
2001-07-14 14:41:30 +00:00
|
|
|
$(MAKE) -C geos || exit 1
|
2003-10-01 20:59:06 +00:00
|
|
|
for i in em joystick tgi conio common runtime zlib; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
2002-12-02 06:10:41 +00:00
|
|
|
LD=$(LD) \
|
2001-07-03 20:24:28 +00:00
|
|
|
AR=$(AR) \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t geos -I../../asminc" \
|
2003-08-03 12:04:59 +00:00
|
|
|
CFLAGS="-Osir -g -T -t geos --forget-inc-paths -I. -I../../include" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
2001-07-14 14:55:08 +00:00
|
|
|
for objfile in $$i/*.o; do \
|
|
|
|
if [ -f geos/$$objfile ]; then \
|
2002-12-02 06:10:41 +00:00
|
|
|
$(AR) a geos.lib geos/$$objfile; \
|
|
|
|
else \
|
|
|
|
$(AR) a geos.lib $$objfile; \
|
|
|
|
fi; \
|
2001-07-14 14:55:08 +00:00
|
|
|
done \
|
2000-05-28 13:40:48 +00:00
|
|
|
done
|
2002-12-25 18:42:42 +00:00
|
|
|
cp geos/devel/*.emd .
|
2002-12-25 19:43:34 +00:00
|
|
|
cp geos/devel/*.joy .
|
2002-12-31 15:35:55 +00:00
|
|
|
cp geos/devel/geos-tgi.tgi geos-tgi.tgi
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2003-04-14 21:28:51 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# NES
|
|
|
|
|
|
|
|
neslib:
|
2003-10-01 20:59:06 +00:00
|
|
|
for i in nes common runtime conio em joystick tgi zlib; do \
|
2003-04-14 21:28:51 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
|
|
|
LD=$(LD) \
|
|
|
|
AFLAGS="-t nes -I../../asminc" \
|
2003-08-03 12:04:59 +00:00
|
|
|
CFLAGS="-Osir -g -T -t nes --forget-inc-paths -I. -I../../include" \
|
2003-04-14 21:28:51 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
$(AR) a nes.lib $$i/*.o;\
|
|
|
|
done
|
|
|
|
mv nes/crt0.o nes.o
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# CBM PET machines
|
|
|
|
|
|
|
|
petlib:
|
2003-10-01 20:59:06 +00:00
|
|
|
for i in pet cbm common runtime conio dbg em joystick tgi zlib; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
2002-12-02 06:10:41 +00:00
|
|
|
LD=$(LD) \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t pet -I../../asminc" \
|
2003-08-03 12:04:59 +00:00
|
|
|
CFLAGS="-Osir -g -T -t pet --forget-inc-paths -I. -I../../include" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
2000-05-28 13:40:48 +00:00
|
|
|
$(AR) a pet.lib $$i/*.o;\
|
|
|
|
done
|
2002-11-29 14:42:12 +00:00
|
|
|
mv pet/crt0.o pet.o
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
2002-11-21 21:22:26 +00:00
|
|
|
# Commodore Plus/4
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
plus4lib:
|
2003-10-01 20:59:06 +00:00
|
|
|
for i in plus4 cbm common runtime conio dbg em joystick tgi zlib; do \
|
2001-03-13 07:56:56 +00:00
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
2002-12-02 06:10:41 +00:00
|
|
|
LD=$(LD) \
|
2002-04-21 14:19:16 +00:00
|
|
|
AFLAGS="-t plus4 -I../../asminc" \
|
2003-08-03 12:04:59 +00:00
|
|
|
CFLAGS="-Osir -g -T -t plus4 --forget-inc-paths -I. -I../../include" \
|
2000-11-23 12:42:39 +00:00
|
|
|
$(MAKE) -C $$i || exit 1; \
|
2000-05-28 13:40:48 +00:00
|
|
|
$(AR) a plus4.lib $$i/*.o;\
|
|
|
|
done
|
2002-11-29 14:42:12 +00:00
|
|
|
mv plus4/crt0.o plus4.o
|
2002-12-21 08:53:39 +00:00
|
|
|
cp plus4/*.joy .
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2003-10-10 16:44:20 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Supervision
|
|
|
|
|
|
|
|
supervisionlib:
|
|
|
|
for i in supervision common runtime; do \
|
|
|
|
CC=$(CC) \
|
|
|
|
AS=$(AS) \
|
|
|
|
LD=$(LD) \
|
|
|
|
AFLAGS="-t supervision -I../../asminc" \
|
|
|
|
CFLAGS="-Osir -g -T -t supervision --forget-inc-paths -I. -I../../include" \
|
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
$(AR) a supervision.lib $$i/*.o;\
|
|
|
|
done
|
|
|
|
mv supervision/crt0.o supervision.o
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Vic20
|
|
|
|
|
|
|
|
vic20lib:
|
|
|
|
for i in vic20 cbm common runtime conio dbg em joystick tgi zlib; do \
|
|
|
|
AS=$(AS) \
|
|
|
|
CC=$(CC) \
|
|
|
|
LD=$(LD) \
|
|
|
|
AFLAGS="-t vic20 -I../../asminc" \
|
|
|
|
CFLAGS="-Osir -g -T -t vic20 --forget-inc-paths -I. -I../../include" \
|
|
|
|
$(MAKE) -C $$i || exit 1; \
|
|
|
|
$(AR) a vic20.lib $$i/*.o;\
|
|
|
|
done
|
|
|
|
mv vic20/crt0.o vic20.o
|
|
|
|
cp vic20/*.joy .
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Dummy targets
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2003-10-01 20:59:06 +00:00
|
|
|
@for i in cbm common conio dbg em joystick runtime serial tgi zlib $(ALLTARGETS); do\
|
|
|
|
$(MAKE) -C $$i clean; \
|
2000-05-28 13:40:48 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
.PHONY: zap
|
|
|
|
zap: clean
|
2003-10-01 20:59:06 +00:00
|
|
|
@for i in cbm common conio dbg em joystick runtime tgi zlib $(ALLTARGETS); do\
|
2003-05-02 09:03:47 +00:00
|
|
|
$(MAKE) -C $$i zap; \
|
2003-02-06 15:35:30 +00:00
|
|
|
done
|
2003-08-20 11:51:44 +00:00
|
|
|
@$(RM) *.o *.emd *.joy *.lib *.tgi
|
2003-02-06 15:35:30 +00:00
|
|
|
|
|
|
|
|
2003-05-02 09:21:35 +00:00
|
|
|
|