.PHONY: geos-cbmlib
geos-cbmlib:
- CC=../$(CC) \
- AS=../$(AS) \
- AR=../$(AR) \
- LD=../$(LD) \
- AFLAGS="-t geos-cbm --forget-inc-paths -I../../../asminc" \
- CFLAGS="-Osir -g -T -t geos-cbm --forget-inc-paths -I. -I../../../include" \
- $(MAKE) -C geos-cbm
- for i in em joystick tgi conio common runtime zlib; do \
- CC=$(CC) \
- AS=$(AS) \
- LD=$(LD) \
- AFLAGS="-t geos-cbm --forget-inc-paths -I../../asminc" \
- CFLAGS="-Osir -g -T -t geos-cbm --forget-inc-paths -I. -I../../include" \
+ for i in runtime geos-cbm common conio em joystick tgi zlib; do \
$(MAKE) SYS=geos-cbm -C $$i || exit 1; \
- for objfile in $$i/*.o; do \
- if [ -f geos-cbm/$$objfile ]; then \
- $(AR) a geos-cbm.lib geos-cbm/$$objfile || exit 1; \
- else \
- $(AR) a geos-cbm.lib $$objfile || exit 1; \
- fi; \
- done \
+ $(AR) a geos-cbm.lib $$i/*.o || exit 1; \
done
- cp geos-cbm/devel/*.emd .
- cp geos-cbm/devel/*.joy .
- cp geos-cbm/devel/*.tgi .
+ cp geos-cbm/*.emd .
+ cp geos-cbm/*.joy .
+ cp geos-cbm/*.tgi .
if [ -d geos-cbm/extra ]; then \
for i in geos-cbm/extra/*.o; do \
cp $$i geos-cbm-`basename $$i` || exit 1; \
#
-# Makefile for GEOS lib
-# for cc65
+# makefile for CC65 runtime library
#
-# Maciej 'YTM/Elysium' Witkowiak
-OBJ_DIRS=common conio devel disk dlgbox file graph menuicon memory mousesprite process runtime system
+.SUFFIXES: .o .s .c
-all:
- @for i in $(OBJ_DIRS); do $(MAKE) -C $$i; done
- @for i in $(OBJ_DIRS); do $(AR) a ../geos-cbm.lib $$i/*.o; done
+#--------------------------------------------------------------------------
+# Programs and flags
-rebuild: zap all clean
+SYS = geos-cbm
+AS = ../../src/ca65/ca65
+CC = ../../src/cc65/cc65
+LD = ../../src/ld65/ld65
+
+AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
+CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
+
+#--------------------------------------------------------------------------
+# Rules
+
+%.o: %.c
+ @$(CC) -o $(notdir $(*).s) $(CFLAGS) $<
+ @$(AS) -o $@ $(AFLAGS) $(*).s
+
+%.o: %.s
+ @$(AS) -g -o $@ $(AFLAGS) $<
+
+%.emd: %.o ../runtime/zeropage.o
+ @$(LD) -o $@ -t module $^
+
+%.joy: %.o ../runtime/zeropage.o
+ @$(LD) -o $@ -t module $^
+
+%.mou: %.o ../runtime/zeropage.o
+ @$(LD) -o $@ -t module $^
+
+%.ser: %.o ../runtime/zeropage.o
+ @$(LD) -o $@ -t module $^
+
+%.tgi: %.o ../runtime/zeropage.o
+ @$(LD) -o $@ -t module $^
+
+#--------------------------------------------------------------------------
+# Directories
+
+DIRS = common \
+ conio \
+ devel \
+ disk \
+ dlgbox \
+ file \
+ graph \
+ menuicon \
+ memory \
+ mousesprite \
+ process \
+ runtime \
+ system
+
+#--------------------------------------------------------------------------
+# Drivers
+
+EMDS = geos-vdc.emd
+
+JOYS = geos-stdjoy.joy
+
+MOUS = #geos-stdmou.mou
+
+SERS =
+
+TGIS = geos-tgi.tgi
+
+#--------------------------------------------------------------------------
+# Directives
+
+include $(addsuffix /Makefile, $(DIRS))
+vpath %.c $(DIRS)
+vpath %.s $(DIRS)
+
+#--------------------------------------------------------------------------
+# Targets
+
+.PHONY: all clean zap
+
+all: $(C_OBJS) $(S_OBJS) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
+
+../runtime/zeropage.o:
+ $(MAKE) -C $(dir $@) $(notdir $@)
-.PHONY: clean
clean:
- @for i in $(OBJ_DIRS); do \
- cd $$i; \
- $(MAKE) clean; \
- cd ..; \
- done
+ @$(RM) $(C_OBJS:.o=.s) $(C_OBJS) $(S_OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(MOUS:.mou=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o)
-.PHONY: zap
zap: clean
- @$(RM) ../geos-cbm.lib
-
+ @$(RM) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
#
-# Makefile for GEOS lib
-# for cc65
+# makefile for CC65 runtime library
#
-%.o: %.c
- @$(CC) $(CFLAGS) $<
- @$(AS) -g -o $@ $(AFLAGS) $(*).s
+#--------------------------------------------------------------------------
+# Object files
-%.o: %.s
- @$(AS) -o $@ $(AFLAGS) $<
+C_OBJS += _afailed.o \
+ abort.o \
+ perror.o \
+ sleep.o
-C_OBJS = _afailed.o abort.o perror.o sleep.o
-S_OBJS = copydata.o memcpy.o memmove.o memset.o zerobss.o
-
-all: $(C_OBJS) $(S_OBJS)
-
-clean:
- @$(RM) core *.~ $(S_OBJS) $(C_OBJS:.o=.s) $(C_OBJS)
+S_OBJS += copydata.o \
+ memcpy.o \
+ memmove.o \
+ memset.o \
+ zerobss.o
#
-# Makefile for GEOS lib
-# for cc65
+# makefile for CC65 runtime library
#
-%.o: %.s
- @$(AS) -o $@ $(AFLAGS) $<
+#--------------------------------------------------------------------------
+# Object files
-
-S_OBJS = cclear.o chline.o cvline.o cgetc.o clrscr.o color.o\
- cputc.o cpputs.o cursor.o gotoxy.o kbhit.o revers.o\
- where.o _scrsize.o
-
-all: $(S_OBJS)
-
-clean:
- @$(RM) *.~ $(S_OBJS) core
+S_OBJS += _scrsize.o \
+ cclear.o \
+ chline.o \
+ cvline.o \
+ cgetc.o \
+ clrscr.o \
+ color.o \
+ cputc.o \
+ cpputs.o \
+ cursor.o \
+ gotoxy.o \
+ kbhit.o \
+ revers.o \
+ where.o
-# -*- make -*-
#
-# Makefile for GEOS lib
-# for cc65
+# makefile for CC65 runtime library
#
-%.o: %.s
- @$(AS) -g -o $@ $(AFLAGS) $<
-
-%.emd: %.o ../../runtime/zeropage.o
- @$(LD) -o $@ -t module $^
-
-%.joy: %.o ../../runtime/zeropage.o
- @$(LD) -o $@ -t module $^
-
-%.mou: %.o ../../runtime/zeropage.o
- @$(LD) -o $@ -t module $^
-
-%.ser: %.o ../../runtime/zeropage.o
- @$(LD) -o $@ -t module $^
-
-%.tgi: %.o ../../runtime/zeropage.o
- @$(LD) -o $@ -t module $^
-
-S_OBJS = crt0.o \
- extzp.o \
- fio_module.o \
- joy_stddrv.o \
- mainargs.o \
- mcbdefault.o \
- mouse_stddrv.o \
- oserror.o \
- oserrlist.o \
- randomize.o \
- tgi_colors.o \
- tgi_stddrv.o
-
#--------------------------------------------------------------------------
-# Drivers
-
-EMDS = geos-vdc.emd
-
-JOYS = geos-stdjoy.joy
-
-MOUS = #geos-stdmou.mou
-
-SERS =
-
-TGIS = geos-tgi.tgi
-
-all: $(S_OBJS) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
-
-../../runtime/zeropage.o:
- $(MAKE) -C $(dir $@) $(notdir $@)
-
-clean:
- @$(RM) *.~ core $(S_OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(MOUS:.mou=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o)
+# Object files
+
+S_OBJS += crt0.o \
+ extzp.o \
+ fio_module.o \
+ joy_stddrv.o \
+ mainargs.o \
+ mcbdefault.o \
+ mouse_stddrv.o \
+ oserror.o \
+ oserrlist.o \
+ randomize.o \
+ tgi_colors.o \
+ tgi_stddrv.o
#
-# Makefile for GEOS lib
-# for cc65
+# makefile for CC65 runtime library
#
-%.o: %.s
- @$(AS) -o $@ $(AFLAGS) $<
+#--------------------------------------------------------------------------
+# Object files
-
-S_OBJS = blkalloc.o calcblksfree.o changediskdevice.o chkdkgeos.o enterturbo.o exitturbo.o\
- findbambit.o freeblock.o getblock.o getdirhead.o getptrcurdknm.o newdisk.o\
- nxtblkalloc.o opendisk.o purgeturbo.o putblock.o putdirhead.o readblock.o\
- readbuff.o setnextfree.o setgeosdisk.o writeblock.o writebuff.o verwriteblock.o\
- gettrse.o setoserror.o\
- dio_openclose.o dio_cts.o dio_stc.o dio_read.o dio_write.o dio_writev.o\
- dio_params.o
-
-all: $(S_OBJS)
-
-clean:
- @$(RM) *.~ $(S_OBJS) core
+S_OBJS += blkalloc.o \
+ calcblksfree.o \
+ changediskdevice.o \
+ chkdkgeos.o \
+ dio_openclose.o \
+ dio_cts.o \
+ dio_params.o \
+ dio_stc.o \
+ dio_read.o \
+ dio_write.o \
+ dio_writev.o \
+ enterturbo.o \
+ exitturbo.o \
+ findbambit.o \
+ freeblock.o \
+ getblock.o \
+ getdirhead.o \
+ getptrcurdknm.o \
+ gettrse.o \
+ newdisk.o \
+ nxtblkalloc.o \
+ opendisk.o \
+ purgeturbo.o \
+ putblock.o \
+ putdirhead.o \
+ readblock.o \
+ readbuff.o \
+ setnextfree.o \
+ setgeosdisk.o \
+ setoserror.o \
+ writeblock.o \
+ writebuff.o \
+ verwriteblock.o
#
-# Makefile for GEOS lib
-# for cc65
+# makefile for CC65 runtime library
#
-#
-
-%.o: %.c
- @$(CC) $(CFLAGS) $<
- @$(AS) -g -o $@ $(AFLAGS) $(*).s
-
-%.o: %.s
- @$(AS) -o $@ $(AFLAGS) $<
-C_OBJS = messagebox.o
-S_OBJS = dodlgbox.o rstrfrmdialogue.o\
- dbget2lines.o dlgboxyesno.o dlgboxokcancel.o dlgboxok.o dlgboxgetstring.o\
- dlgboxfileselect.o
+#--------------------------------------------------------------------------
+# Object files
-all: $(C_OBJS) $(S_OBJS)
+C_OBJS += messagebox.o
-clean:
- @$(RM) core *.~ $(S_OBJS) $(C_OBJS:.o=.s) $(C_OBJS)
+S_OBJS += dodlgbox.o \
+ rstrfrmdialogue.o \
+ dbget2lines.o \
+ dlgboxyesno.o \
+ dlgboxokcancel.o \
+ dlgboxok.o \
+ dlgboxgetstring.o \
+ dlgboxfileselect.o
#
-# Makefile for GEOS lib
-# for cc65
+# makefile for CC65 runtime library
#
-%.o: %.s
- @$(AS) -o $@ $(AFLAGS) $<
+#--------------------------------------------------------------------------
+# Object files
-
-S_OBJS = get1stdirentry.o getnxtdirentry.o\
- openrecordfile.o closerecordfile.o nextrecord.o previousrecord.o pointrecord.o\
- deleterecord.o insertrecord.o appendrecord.o readrecord.o writerecord.o\
- updaterecordfile.o\
- findfile.o followchain.o getfhdrinfo.o readfile.o savefile.o freefile.o\
- deletefile.o renamefile.o findftypes.o readbyte.o getfile.o\
- sysremove.o sysrename.o
-
-all: $(S_OBJS)
-
-clean:
- @$(RM) *.~ $(S_OBJS) core
+S_OBJS += get1stdirentry.o \
+ getnxtdirentry.o \
+ openrecordfile.o \
+ closerecordfile.o \
+ nextrecord.o \
+ previousrecord.o \
+ pointrecord.o \
+ deleterecord.o \
+ insertrecord.o \
+ appendrecord.o \
+ readrecord.o \
+ writerecord.o \
+ updaterecordfile.o \
+ findfile.o \
+ followchain.o \
+ getfhdrinfo.o \
+ readfile.o \
+ savefile.o \
+ freefile.o \
+ deletefile.o \
+ renamefile.o \
+ findftypes.o \
+ readbyte.o \
+ getfile.o \
+ sysremove.o \
+ sysrename.o
#
-# Makefile for GEOS lib
-# for cc65
+# makefile for CC65 runtime library
#
-#
-
-%.o: %.s
- @$(AS) -o $@ $(AFLAGS) $<
-
-
-S_OBJS = drawline.o drawpoint.o framerectangle.o hlineregs.o horizontalline.o\
- imprintrectangle.o invertline.o invertrectangle.o pointregs.o recoverline.o\
- recoverrectangle.o rectangle.o initdrawwindow.o setpattern.o testpoint.o verticalline.o\
- put_char.o putdecimal.o putstring.o usesystemfont.o\
- getcharwidth.o loadcharset.o bitmapup.o bitmapregs.o bitmapclip.o bitotherclip.o\
- graphicsstring.o getintcharint.o
-all: $(S_OBJS)
+#--------------------------------------------------------------------------
+# Object files
-clean:
- @$(RM) *.~ $(S_OBJS) core
+S_OBJS += drawline.o \
+ drawpoint.o \
+ framerectangle.o \
+ hlineregs.o \
+ horizontalline.o \
+ imprintrectangle.o \
+ invertline.o \
+ invertrectangle.o \
+ pointregs.o \
+ recoverline.o \
+ recoverrectangle.o \
+ rectangle.o \
+ initdrawwindow.o \
+ setpattern.o \
+ testpoint.o \
+ verticalline.o \
+ put_char.o \
+ putdecimal.o \
+ putstring.o \
+ usesystemfont.o \
+ getcharwidth.o \
+ loadcharset.o \
+ bitmapup.o \
+ bitmapregs.o \
+ bitmapclip.o \
+ bitotherclip.o \
+ graphicsstring.o \
+ getintcharint.o
#
-# Makefile for GEOS lib
-# for cc65
+# makefile for CC65 runtime library
#
-#
-
-%.o: %.s
- @$(AS) -o $@ $(AFLAGS) $<
-
-
-S_OBJS = crc.o doublepop.o reuregs.o clearram.o fillram.o initram.o movedata.o\
- stashram.o fetchram.o swapram.o verifyram.o\
- doublespop.o copystring.o cmpstring.o copyfstring.o cmpfstring.o
-all: $(S_OBJS)
+#--------------------------------------------------------------------------
+# Object files
-clean:
- @$(RM) *.~ $(S_OBJS) core
+S_OBJS += crc.o \
+ doublepop.o \
+ reuregs.o \
+ clearram.o \
+ fillram.o \
+ initram.o \
+ movedata.o \
+ stashram.o \
+ fetchram.o \
+ swapram.o \
+ verifyram.o \
+ doublespop.o \
+ copystring.o \
+ cmpstring.o \
+ copyfstring.o \
+ cmpfstring.o
#
-# Makefile for GEOS lib
-# for cc65
+# makefile for CC65 runtime library
#
-#
-
-%.o: %.s
- @$(AS) -o $@ $(AFLAGS) $<
-
-
-S_OBJS = domenu.o dopreviousmenu.o redomenu.o recovermenu.o recoverallmenus.o\
- gotofirstmenu.o doicons.o
-all: $(S_OBJS)
+#--------------------------------------------------------------------------
+# Object files
-clean:
- @$(RM) *.~ $(S_OBJS) core
+S_OBJS += domenu.o \
+ dopreviousmenu.o \
+ redomenu.o \
+ recovermenu.o \
+ recoverallmenus.o \
+ gotofirstmenu.o \
+ doicons.o
#
-# Makefile for GEOS lib
-# for cc65
+# makefile for CC65 runtime library
#
-#
-
-%.o: %.s
- @$(AS) -o $@ $(AFLAGS) $<
-
-
-S_OBJS = startmousemode.o clearmousemode.o mouseup.o mouseoff.o\
- drawsprite.o possprite.o enablsprite.o disablsprite.o\
- ismseinregion.o inittextprompt.o promptoff.o prompton.o\
- getnextchar.o\
- mouse.o
-all: $(S_OBJS)
+#--------------------------------------------------------------------------
+# Object files
-clean:
- @$(RM) *.~ $(S_OBJS) core
+S_OBJS += startmousemode.o \
+ clearmousemode.o \
+ mouseup.o \
+ mouseoff.o \
+ drawsprite.o \
+ possprite.o \
+ enablsprite.o \
+ disablsprite.o \
+ ismseinregion.o \
+ inittextprompt.o \
+ promptoff.o \
+ prompton.o \
+ getnextchar.o \
+ mouse.o
#
-# Makefile for GEOS lib
-# for cc65
+# makefile for CC65 runtime library
#
-#
-
-%.o: %.s
- @$(AS) -o $@ $(AFLAGS) $<
-
-
-S_OBJS = processinitrestartenable.o processblock.o processfreeze.o processsleep.o
-all: $(S_OBJS)
+#--------------------------------------------------------------------------
+# Object files
-clean:
- @$(RM) *.~ $(S_OBJS) core
+S_OBJS += processinitrestartenable.o \
+ processblock.o \
+ processfreeze.o \
+ processsleep.o
#
-# Makefile for GEOS lib
-# for cc65
+# makefile for CC65 runtime library
#
-%.o: %.c
- @$(CC) $(CFLAGS) $<
- @$(AS) -g -o $@ $(AFLAGS) $(*).s
+#--------------------------------------------------------------------------
+# Object files
-%.o: %.s
- @$(AS) -o $@ $(AFLAGS) $<
-
-C_OBJS =
-S_OBJS = call.o
-
-all: $(C_OBJS) $(S_OBJS)
-
-clean:
- @$(RM) core *.~ $(S_OBJS) $(C_OBJS:.o=.s) $(C_OBJS)
+S_OBJS += call.o
#
-# Makefile for GEOS lib
-# for cc65
+# makefile for CC65 runtime library
#
-#
-
-%.o: %.s
- @$(AS) -o $@ $(AFLAGS) $<
-
-%.o: %.c
- @$(CC) $(CFLAGS) $<
- @$(AS) -g -o $@ $(AFLAGS) $(*).s
-
-S_OBJS = ctype.o \
- callroutine.o \
- enterdesktop.o \
- firstinit.o \
- get_ostype.o \
- getrandom.o \
- getserialnumber.o \
- initdoneio.o \
- mainloop.o \
- panic.o \
- tobasic.o \
- setdevice.o \
- sysuname.o
-C_OBJS = systime.o
+#--------------------------------------------------------------------------
+# Object files
-all: $(C_OBJS) $(S_OBJS)
+C_OBJS += systime.o
-clean:
- @$(RM) *.~ $(C_OBJS:.o=.s) $(C_OBJS) $(S_OBJS) core
+S_OBJS += ctype.o \
+ callroutine.o \
+ enterdesktop.o \
+ firstinit.o \
+ get_ostype.o \
+ getrandom.o \
+ getserialnumber.o \
+ initdoneio.o \
+ mainloop.o \
+ panic.o \
+ tobasic.o \
+ setdevice.o \
+ sysuname.o