1
0
mirror of https://github.com/cc65/cc65.git synced 2025-08-10 04:25:21 +00:00

The cc65 library build system is designed to call sub-makes in direct sub-directories of 'libsrc' only (meaning that sub-sub-directories are not supported). The GEOSLib source files however are organized in sub-directories of the 'libsrc/geos-cbm'. This mismatch was up to now handled by replicating the cc65 library build system functionality to allow for individal sub-makes in each 'libsrc/geos-cbm' sub-directory. This is unnecessarily hard understand and causes additional maintainance effort.

Now the whole GEOSLib is built in a single make instance running in 'libsrc/geos-cbm' - which is just what the cc65 library build system can handle. The 'libsrc/geos-cbm' sub-directories still contain Makefiles. However those files only define the set of object files to create from their sub-directory and get included into the 'libsrc/geos-cbm' Makefile.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5429 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
ol.sc
2012-01-30 21:19:09 +00:00
parent 0fb3e47b60
commit 0c69d4866c
15 changed files with 315 additions and 285 deletions

View File

@@ -250,31 +250,13 @@ cbm610lib:
.PHONY: geos-cbmlib .PHONY: geos-cbmlib
geos-cbmlib: geos-cbmlib:
CC=../$(CC) \ for i in runtime geos-cbm common conio em joystick tgi zlib; do \
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" \
$(MAKE) SYS=geos-cbm -C $$i || exit 1; \ $(MAKE) SYS=geos-cbm -C $$i || exit 1; \
for objfile in $$i/*.o; do \ $(AR) a geos-cbm.lib $$i/*.o || exit 1; \
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 \
done done
cp geos-cbm/devel/*.emd . cp geos-cbm/*.emd .
cp geos-cbm/devel/*.joy . cp geos-cbm/*.joy .
cp geos-cbm/devel/*.tgi . cp geos-cbm/*.tgi .
if [ -d geos-cbm/extra ]; then \ if [ -d geos-cbm/extra ]; then \
for i in geos-cbm/extra/*.o; do \ for i in geos-cbm/extra/*.o; do \
cp $$i geos-cbm-`basename $$i` || exit 1; \ cp $$i geos-cbm-`basename $$i` || exit 1; \

View File

@@ -1,27 +1,95 @@
# #
# Makefile for GEOS lib # makefile for CC65 runtime library
# for cc65
# #
# 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 # Programs and flags
@for i in $(OBJ_DIRS); do $(AR) a ../geos-cbm.lib $$i/*.o; done
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: clean:
@for i in $(OBJ_DIRS); do \ @$(RM) $(C_OBJS:.o=.s) $(C_OBJS) $(S_OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(MOUS:.mou=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o)
cd $$i; \
$(MAKE) clean; \
cd ..; \
done
.PHONY: zap
zap: clean zap: clean
@$(RM) ../geos-cbm.lib @$(RM) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)

View File

@@ -1,19 +1,17 @@
# #
# Makefile for GEOS lib # makefile for CC65 runtime library
# for cc65
# #
%.o: %.c #--------------------------------------------------------------------------
@$(CC) $(CFLAGS) $< # Object files
@$(AS) -g -o $@ $(AFLAGS) $(*).s
%.o: %.s C_OBJS += _afailed.o \
@$(AS) -o $@ $(AFLAGS) $< abort.o \
perror.o \
sleep.o
C_OBJS = _afailed.o abort.o perror.o sleep.o S_OBJS += copydata.o \
S_OBJS = copydata.o memcpy.o memmove.o memset.o zerobss.o memcpy.o \
memmove.o \
all: $(C_OBJS) $(S_OBJS) memset.o \
zerobss.o
clean:
@$(RM) core *.~ $(S_OBJS) $(C_OBJS:.o=.s) $(C_OBJS)

View File

@@ -1,17 +1,21 @@
# #
# Makefile for GEOS lib # makefile for CC65 runtime library
# for cc65
# #
%.o: %.s #--------------------------------------------------------------------------
@$(AS) -o $@ $(AFLAGS) $< # Object files
S_OBJS += _scrsize.o \
S_OBJS = cclear.o chline.o cvline.o cgetc.o clrscr.o color.o\ cclear.o \
cputc.o cpputs.o cursor.o gotoxy.o kbhit.o revers.o\ chline.o \
where.o _scrsize.o cvline.o \
cgetc.o \
all: $(S_OBJS) clrscr.o \
color.o \
clean: cputc.o \
@$(RM) *.~ $(S_OBJS) core cpputs.o \
cursor.o \
gotoxy.o \
kbhit.o \
revers.o \
where.o

View File

@@ -1,28 +1,11 @@
# -*- make -*-
# #
# Makefile for GEOS lib # makefile for CC65 runtime library
# for cc65
# #
%.o: %.s #--------------------------------------------------------------------------
@$(AS) -g -o $@ $(AFLAGS) $< # Object files
%.emd: %.o ../../runtime/zeropage.o S_OBJS += crt0.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 \ extzp.o \
fio_module.o \ fio_module.o \
joy_stddrv.o \ joy_stddrv.o \
@@ -34,24 +17,3 @@ S_OBJS = crt0.o \
randomize.o \ randomize.o \
tgi_colors.o \ tgi_colors.o \
tgi_stddrv.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)

View File

@@ -1,21 +1,40 @@
# #
# Makefile for GEOS lib # makefile for CC65 runtime library
# for cc65
# #
%.o: %.s #--------------------------------------------------------------------------
@$(AS) -o $@ $(AFLAGS) $< # Object files
S_OBJS += blkalloc.o \
S_OBJS = blkalloc.o calcblksfree.o changediskdevice.o chkdkgeos.o enterturbo.o exitturbo.o\ calcblksfree.o \
findbambit.o freeblock.o getblock.o getdirhead.o getptrcurdknm.o newdisk.o\ changediskdevice.o \
nxtblkalloc.o opendisk.o purgeturbo.o putblock.o putdirhead.o readblock.o\ chkdkgeos.o \
readbuff.o setnextfree.o setgeosdisk.o writeblock.o writebuff.o verwriteblock.o\ dio_openclose.o \
gettrse.o setoserror.o\ dio_cts.o \
dio_openclose.o dio_cts.o dio_stc.o dio_read.o dio_write.o dio_writev.o\ dio_params.o \
dio_params.o dio_stc.o \
dio_read.o \
all: $(S_OBJS) dio_write.o \
dio_writev.o \
clean: enterturbo.o \
@$(RM) *.~ $(S_OBJS) core 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

View File

@@ -1,22 +1,17 @@
# #
# Makefile for GEOS lib # makefile for CC65 runtime library
# for cc65
#
# #
%.o: %.c #--------------------------------------------------------------------------
@$(CC) $(CFLAGS) $< # Object files
@$(AS) -g -o $@ $(AFLAGS) $(*).s
%.o: %.s C_OBJS += messagebox.o
@$(AS) -o $@ $(AFLAGS) $<
C_OBJS = messagebox.o S_OBJS += dodlgbox.o \
S_OBJS = dodlgbox.o rstrfrmdialogue.o\ rstrfrmdialogue.o \
dbget2lines.o dlgboxyesno.o dlgboxokcancel.o dlgboxok.o dlgboxgetstring.o\ dbget2lines.o \
dlgboxyesno.o \
dlgboxokcancel.o \
dlgboxok.o \
dlgboxgetstring.o \
dlgboxfileselect.o dlgboxfileselect.o
all: $(C_OBJS) $(S_OBJS)
clean:
@$(RM) core *.~ $(S_OBJS) $(C_OBJS:.o=.s) $(C_OBJS)

View File

@@ -1,21 +1,33 @@
# #
# Makefile for GEOS lib # makefile for CC65 runtime library
# for cc65
# #
%.o: %.s #--------------------------------------------------------------------------
@$(AS) -o $@ $(AFLAGS) $< # Object files
S_OBJS += get1stdirentry.o \
S_OBJS = get1stdirentry.o getnxtdirentry.o\ getnxtdirentry.o \
openrecordfile.o closerecordfile.o nextrecord.o previousrecord.o pointrecord.o\ openrecordfile.o \
deleterecord.o insertrecord.o appendrecord.o readrecord.o writerecord.o\ closerecordfile.o \
updaterecordfile.o\ nextrecord.o \
findfile.o followchain.o getfhdrinfo.o readfile.o savefile.o freefile.o\ previousrecord.o \
deletefile.o renamefile.o findftypes.o readbyte.o getfile.o\ pointrecord.o \
sysremove.o sysrename.o deleterecord.o \
insertrecord.o \
all: $(S_OBJS) appendrecord.o \
readrecord.o \
clean: writerecord.o \
@$(RM) *.~ $(S_OBJS) core 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

View File

@@ -1,21 +1,35 @@
# #
# Makefile for GEOS lib # makefile for CC65 runtime library
# for cc65
#
# #
%.o: %.s #--------------------------------------------------------------------------
@$(AS) -o $@ $(AFLAGS) $< # Object files
S_OBJS += drawline.o \
S_OBJS = drawline.o drawpoint.o framerectangle.o hlineregs.o horizontalline.o\ drawpoint.o \
imprintrectangle.o invertline.o invertrectangle.o pointregs.o recoverline.o\ framerectangle.o \
recoverrectangle.o rectangle.o initdrawwindow.o setpattern.o testpoint.o verticalline.o\ hlineregs.o \
put_char.o putdecimal.o putstring.o usesystemfont.o\ horizontalline.o \
getcharwidth.o loadcharset.o bitmapup.o bitmapregs.o bitmapclip.o bitotherclip.o\ imprintrectangle.o \
graphicsstring.o getintcharint.o invertline.o \
invertrectangle.o \
all: $(S_OBJS) pointregs.o \
recoverline.o \
clean: recoverrectangle.o \
@$(RM) *.~ $(S_OBJS) core 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

View File

@@ -1,18 +1,23 @@
# #
# Makefile for GEOS lib # makefile for CC65 runtime library
# for cc65
#
# #
%.o: %.s #--------------------------------------------------------------------------
@$(AS) -o $@ $(AFLAGS) $< # Object files
S_OBJS += crc.o \
S_OBJS = crc.o doublepop.o reuregs.o clearram.o fillram.o initram.o movedata.o\ doublepop.o \
stashram.o fetchram.o swapram.o verifyram.o\ reuregs.o \
doublespop.o copystring.o cmpstring.o copyfstring.o cmpfstring.o clearram.o \
fillram.o \
all: $(S_OBJS) initram.o \
movedata.o \
clean: stashram.o \
@$(RM) *.~ $(S_OBJS) core fetchram.o \
swapram.o \
verifyram.o \
doublespop.o \
copystring.o \
cmpstring.o \
copyfstring.o \
cmpfstring.o

View File

@@ -1,17 +1,14 @@
# #
# Makefile for GEOS lib # makefile for CC65 runtime library
# for cc65
#
# #
%.o: %.s #--------------------------------------------------------------------------
@$(AS) -o $@ $(AFLAGS) $< # Object files
S_OBJS += domenu.o \
S_OBJS = domenu.o dopreviousmenu.o redomenu.o recovermenu.o recoverallmenus.o\ dopreviousmenu.o \
gotofirstmenu.o doicons.o redomenu.o \
recovermenu.o \
all: $(S_OBJS) recoverallmenus.o \
gotofirstmenu.o \
clean: doicons.o
@$(RM) *.~ $(S_OBJS) core

View File

@@ -1,20 +1,21 @@
# #
# Makefile for GEOS lib # makefile for CC65 runtime library
# for cc65
#
# #
%.o: %.s #--------------------------------------------------------------------------
@$(AS) -o $@ $(AFLAGS) $< # Object files
S_OBJS += startmousemode.o \
S_OBJS = startmousemode.o clearmousemode.o mouseup.o mouseoff.o\ clearmousemode.o \
drawsprite.o possprite.o enablsprite.o disablsprite.o\ mouseup.o \
ismseinregion.o inittextprompt.o promptoff.o prompton.o\ mouseoff.o \
getnextchar.o\ drawsprite.o \
possprite.o \
enablsprite.o \
disablsprite.o \
ismseinregion.o \
inittextprompt.o \
promptoff.o \
prompton.o \
getnextchar.o \
mouse.o mouse.o
all: $(S_OBJS)
clean:
@$(RM) *.~ $(S_OBJS) core

View File

@@ -1,16 +1,11 @@
# #
# Makefile for GEOS lib # makefile for CC65 runtime library
# for cc65
#
# #
%.o: %.s #--------------------------------------------------------------------------
@$(AS) -o $@ $(AFLAGS) $< # Object files
S_OBJS += processinitrestartenable.o \
S_OBJS = processinitrestartenable.o processblock.o processfreeze.o processsleep.o processblock.o \
processfreeze.o \
all: $(S_OBJS) processsleep.o
clean:
@$(RM) *.~ $(S_OBJS) core

View File

@@ -1,19 +1,8 @@
# #
# Makefile for GEOS lib # makefile for CC65 runtime library
# for cc65
# #
%.o: %.c #--------------------------------------------------------------------------
@$(CC) $(CFLAGS) $< # Object files
@$(AS) -g -o $@ $(AFLAGS) $(*).s
%.o: %.s S_OBJS += call.o
@$(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)

View File

@@ -1,17 +1,13 @@
# #
# Makefile for GEOS lib # makefile for CC65 runtime library
# for cc65
#
# #
%.o: %.s #--------------------------------------------------------------------------
@$(AS) -o $@ $(AFLAGS) $< # Object files
%.o: %.c C_OBJS += systime.o
@$(CC) $(CFLAGS) $<
@$(AS) -g -o $@ $(AFLAGS) $(*).s
S_OBJS = ctype.o \ S_OBJS += ctype.o \
callroutine.o \ callroutine.o \
enterdesktop.o \ enterdesktop.o \
firstinit.o \ firstinit.o \
@@ -24,10 +20,3 @@ S_OBJS = ctype.o \
tobasic.o \ tobasic.o \
setdevice.o \ setdevice.o \
sysuname.o sysuname.o
C_OBJS = systime.o
all: $(C_OBJS) $(S_OBJS)
clean:
@$(RM) *.~ $(C_OBJS:.o=.s) $(C_OBJS) $(S_OBJS) core