Replaced whole bunch for Makefiles with a single generic Makefile.

- No complex shell logic.
- "Source file shadowing" for all targets via vpath.
- Dependency handling.
- True incremental build.
- Don't write into source directories.
- Easy cleanup by just removing 'wrk'.
This commit is contained in:
Oliver Schmidt
2013-05-04 22:10:48 +02:00
parent 2cd8e140ad
commit 008b4c4e1d
138 changed files with 36 additions and 3707 deletions

View File

@@ -1,94 +0,0 @@
#
# makefile for CC65 runtime library
#
.SUFFIXES: .o .s .c
#--------------------------------------------------------------------------
# Programs and flags
SYS = geos-cbm
AS = ../../src/ca65/ca65
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
AFLAGS = -t $(SYS) --forget-inc-paths -I. -I../$(SYS) -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 \
dlgbox \
disk \
file \
graph \
memory \
menuicon \
mousesprite \
process \
runtime \
system
#--------------------------------------------------------------------------
# Drivers
EMDS =
JOYS =
MOUS = #geos-stdmou.mou
SERS =
TGIS =
#--------------------------------------------------------------------------
# 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 $@)
clean:
@$(RM) $(C_OBJS:.o=.s) $(C_OBJS) $(S_OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(MOUS:.mou=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o)
zap: clean
@$(RM) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)

View File

@@ -1,18 +0,0 @@
#
# makefile for CC65 runtime library
#
#--------------------------------------------------------------------------
# Object files
C_OBJS += _afailed.o \
_poserror.o \
abort.o \
perror.o \
sleep.o
S_OBJS += copydata.o \
memcpy.o \
memmove.o \
memset.o \
zerobss.o

View File

@@ -1,18 +0,0 @@
#
# makefile for CC65 runtime library
#
#--------------------------------------------------------------------------
# Object files
S_OBJS += _scrsize.o \
cclear.o \
cgetc.o \
chline.o \
clrscr.o \
cputc.o \
cvline.o \
dummies.o \
gotoxy.o \
kbhit.o \
where.o

View File

@@ -1,19 +0,0 @@
#
# makefile for CC65 runtime library
#
#--------------------------------------------------------------------------
# Object files
S_OBJS += blkalloc.o \
calcblksfree.o \
freeblock.o \
getblock.o \
getdirhead.o \
getptrcurdknm.o \
gettrse.o \
nxtblkalloc.o \
opendisk.o \
putblock.o \
putdirhead.o \
setnextfree.o

View File

@@ -1,17 +0,0 @@
#
# makefile for CC65 runtime library
#
#--------------------------------------------------------------------------
# Object files
C_OBJS += messagebox.o
S_OBJS += dbget2lines.o \
dlgboxgetstring.o \
dlgboxfileselect.o \
dlgboxok.o \
dlgboxokcancel.o \
dlgboxyesno.o \
dodlgbox.o \
rstrfrmdialogue.o

View File

@@ -1,10 +0,0 @@
#
# makefile for CC65 runtime library
#
#--------------------------------------------------------------------------
# Object files
S_OBJS += fio_module.o \
mcbdefault.o \
mouse_stddrv.o

View File

@@ -1,32 +0,0 @@
#
# makefile for CC65 runtime library
#
#--------------------------------------------------------------------------
# Object files
S_OBJS += appendrecord.o \
closerecordfile.o \
deletefile.o \
deleterecord.o \
findfile.o \
findftypes.o \
freefile.o \
get1stdirentry.o \
getfhdrinfo.o \
getfile.o \
getnxtdirentry.o \
insertrecord.o \
nextrecord.o \
openrecordfile.o \
pointrecord.o \
previousrecord.o \
readbyte.o \
readfile.o \
readrecord.o \
renamefile.o \
savefile.o \
sysremove.o \
sysrename.o \
updaterecordfile.o \
writerecord.o

View File

@@ -1,35 +0,0 @@
#
# makefile for CC65 runtime library
#
#--------------------------------------------------------------------------
# Object files
S_OBJS += bitmapclip.o \
bitmapregs.o \
bitmapup.o \
bitotherclip.o \
drawline.o \
drawpoint.o \
framerectangle.o \
getcharwidth.o \
getintcharint.o \
graphicsstring.o \
hlineregs.o \
horizontalline.o \
imprintrectangle.o \
initdrawwindow.o \
invertline.o \
invertrectangle.o \
loadcharset.o \
pointregs.o \
put_char.o \
putdecimal.o \
putstring.o \
recoverline.o \
recoverrectangle.o \
rectangle.o \
setpattern.o \
testpoint.o \
usesystemfont.o \
verticalline.o

View File

@@ -1,18 +0,0 @@
#
# makefile for CC65 runtime library
#
#--------------------------------------------------------------------------
# Object files
S_OBJS += clearram.o \
cmpfstring.o \
cmpstring.o \
copyfstring.o \
copystring.o \
crc.o \
doublepop.o \
doublespop.o \
fillram.o \
initram.o \
movedata.o

View File

@@ -1,14 +0,0 @@
#
# makefile for CC65 runtime library
#
#--------------------------------------------------------------------------
# Object files
S_OBJS += doicons.o \
domenu.o \
dopreviousmenu.o \
gotofirstmenu.o \
recoverallmenus.o \
recovermenu.o \
redomenu.o

View File

@@ -1,20 +0,0 @@
#
# makefile for CC65 runtime library
#
#--------------------------------------------------------------------------
# Object files
S_OBJS += clearmousemode.o \
disablsprite.o \
drawsprite.o \
enablsprite.o \
getnextchar.o \
inittextprompt.o \
ismseinregion.o \
mouseoff.o \
mouseup.o \
possprite.o \
promptoff.o \
prompton.o \
startmousemode.o

View File

@@ -1,11 +0,0 @@
#
# makefile for CC65 runtime library
#
#--------------------------------------------------------------------------
# Object files
S_OBJS += processblock.o \
processfreeze.o \
processinitrestartenable.o \
processsleep.o

View File

@@ -1,8 +0,0 @@
#
# makefile for CC65 runtime library
#
#--------------------------------------------------------------------------
# Object files
S_OBJS += call.o

View File

@@ -1,24 +0,0 @@
#
# makefile for CC65 runtime library
#
#--------------------------------------------------------------------------
# Object files
C_OBJS += systime.o
S_OBJS += callroutine.o \
crt0.o \
ctype.o \
enterdesktop.o \
extzp.o \
firstinit.o \
getrandom.o \
mainargs.o \
mainloop.o \
oserrlist.o \
oserror.o \
panic.o \
randomize.o \
setoserror.o \
sysuname.o

View File

@@ -0,0 +1,15 @@
;
; Name of the standard joystick driver
;
; Ullrich von Bassewitz, 2002-12-21
;
; const char joy_stddrv[];
;
.export _joy_stddrv
.rodata
_joy_stddrv:
.asciiz "geos-stdjoy.joy"

View File

@@ -0,0 +1,8 @@
;
; Target-specific black & white values, for use by the target-shared TGI kernel
;
.include "tgi-kernel.inc"
tgi_color_black = $00
tgi_color_white = $01

View File

@@ -0,0 +1,14 @@
;
; Name of the standard tgi driver
;
; Oliver Schmidt, 2011-05-02
;
; const char tgi_stddrv[];
;
.export _tgi_stddrv
.rodata
_tgi_stddrv:
.asciiz "geos-tgi.tgi"