Replaced whole bunch for Makefiles with a single generic Makefile.

- Targeting GNU toolchain.
- Modern dependency handling.
- Warning-free build.
- GCC option -Werror set.
- Dynamic search paths.
- Don't write into source directories.
- Easy cleanup by just removing 'wrk'.
This commit is contained in:
Oliver Schmidt
2013-04-27 17:19:52 +02:00
parent ede72d78b2
commit 052b229f86
30 changed files with 76 additions and 2765 deletions

View File

@@ -1,104 +0,0 @@
#
# cc65 Makefile for the cc65 common directory
#
RM = rm -f
SYS = c64
CFLAGS = -g -T -t $(SYS) -Oirs --standard c89
AS = ../ca65/ca65
AR = ../ar65/ar65
CC = ../cc65/cc65
LDFLAGS =
LIB = common.lib
# --------------------------------------------------------------------------
# Generic rules
.c.o:
@echo $<
@$(CC) $(CFLAGS) $<
@$(AS) $(basename $<).s
.s.o:
@echo $<
@$(AS) $(MY_ASM) -t $(SYS) $<
.o:
@$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^ $(CLIB)
# --------------------------------------------------------------------------
# Object files for the library
OBJS = abend.o \
addrsize.o \
assertion.o \
bitops.o \
chartype.o \
check.o \
cmdline.o \
coll.o \
cpu.o \
debugflag.o \
exprdefs.o \
filepos.o \
filetype.o \
fname.o \
fp.o \
hashstr.o \
hashtab.o \
intstack.o \
matchpat.o \
mmodel.o \
print.o \
searchpath.o \
segdefs.o \
segnames.o \
shift.o \
strbuf.o \
strpool.o \
strstack.o \
strutil.o \
target.o \
tgttrans.o \
version.o \
xmalloc.o \
xsprintf.o
# ------------------------------------------------------------------------------
# Dummy targets
.PHONY: all
ifeq (.depend,$(wildcard .depend))
all: lib
include .depend
else
all: depend
@$(MAKE) -f make/gcc.mak all
endif
.PHONY: lib
lib: $(LIB)
$(LIB): $(OBJS)
$(AR) a $(LIB) $?
clean:
$(RM) *~ core *.map
zap: clean
$(RM) *.o $(LIB) .depend
# ------------------------------------------------------------------------------
# Make the dependencies
.PHONY: depend dep
depend dep: $(OBJS:.o=.c)
@echo "Creating dependency information"
$(CC) $(CFLAGS) -MM $^ > .depend

View File

@@ -1,88 +0,0 @@
#
# gcc Makefile for the cc65 common directory
#
RM = rm -f
AR = ar
CFLAGS = -g -O2 -Wall -W -std=c89
CC = gcc
LDFLAGS =
LIB = common.a
# ------------------------------------------------------------------------------
# Object files for the library
OBJS = abend.o \
addrsize.o \
alignment.o \
assertion.o \
bitops.o \
chartype.o \
check.o \
cmdline.o \
coll.o \
cpu.o \
debugflag.o \
exprdefs.o \
fileid.o \
filepos.o \
filestat.o \
filetime.o \
filetype.o \
fname.o \
fp.o \
gentype.o \
hashfunc.o \
hashtab.o \
intstack.o \
matchpat.o \
mmodel.o \
print.o \
searchpath.o \
segnames.o \
shift.o \
strbuf.o \
strpool.o \
strstack.o \
strutil.o \
target.o \
tgttrans.o \
version.o \
xmalloc.o \
xsprintf.o
# ------------------------------------------------------------------------------
# Dummy targets
.PHONY: all
ifeq (.depend,$(wildcard .depend))
all: lib
include .depend
else
all: depend
@$(MAKE) -f make/gcc.mak all
endif
.PHONY: lib
lib: $(LIB)
$(LIB): $(OBJS)
$(AR) rs $(LIB) $?
clean:
$(RM) *~ core *.map
zap: clean
$(RM) *.o $(LIB) .depend
# ------------------------------------------------------------------------------
# Make the dependencies
.PHONY: depend dep
depend dep: $(OBJS:.o=.c)
@echo "Creating dependency information"
$(CC) $(CFLAGS) -MM $^ > .depend

View File

@@ -1,125 +0,0 @@
#
# CC65 Makefile for the Watcom compiler (using GNU make) and wine
#
# ------------------------------------------------------------------------------
# Generic stuff
# Environment variables for the watcom compiler
export WATCOM = c:\\watcom
export INCLUDE = $(WATCOM)\\h
# We will use the windows compiler under linux (define as empty for windows)
export WINEDEBUG=fixme-all
WINE = wine
# Programs
AR = $(WINE) wlib
CC = $(WINE) wcc386
LD = $(WINE) wlink
LIB = common.lib
# Program arguments
CFLAGS = -d1 -obeilr -zp4 -5 -zq -w2
# Create NT programs by default
ifndef TARGET
TARGET = NT
endif
# --------------------- OS2 ---------------------
ifeq ($(TARGET),OS2)
SYSTEM = os2v2
CFLAGS += -bt=$(TARGET)
endif
# -------------------- DOS4G --------------------
ifeq ($(TARGET),DOS32)
SYSTEM = dos4g
CFLAGS += -bt=$(TARGET)
endif
# --------------------- NT ----------------------
ifeq ($(TARGET),NT)
SYSTEM = nt
CFLAGS += -bt=$(TARGET)
endif
# ------------------------------------------------------------------------------
# Implicit rules
%.obj: %.c
$(CC) $(CFLAGS) -fo=$@ $^
# ------------------------------------------------------------------------------
# All library OBJ files
OBJS = abend.obj \
addrsize.obj \
alignment.obj \
assertion.obj \
bitops.obj \
chartype.obj \
check.obj \
cmdline.obj \
coll.obj \
cpu.obj \
debugflag.obj \
exprdefs.obj \
fileid.obj \
filepos.obj \
filestat.obj \
filetime.obj \
filetype.obj \
fname.obj \
fp.obj \
gentype.obj \
hashfunc.obj \
hashtab.obj \
intstack.obj \
matchpat.obj \
mmodel.obj \
print.obj \
searchpath.obj \
segnames.obj \
shift.obj \
strbuf.obj \
strpool.obj \
strstack.obj \
strutil.obj \
target.obj \
tgttrans.obj \
version.obj \
wildargv.obj \
xmalloc.obj \
xsprintf.obj
# ------------------------------------------------------------------------------
# Main targets
all: lib
lib: $(LIB)
$(LIB): $(OBJS)
@echo Creating library...
$(AR) -q -b -P=32 $(LIB) $(foreach OBJ, $(OBJS), +-$(OBJ))
@echo Done!
wildargv.obj:
$(CC) $(CFLAGS) -fo=$@ $(WATCOM)\\src\\startup\\wildargv.c
clean:
@rm -f *~ core
zap: clean
@rm -f *.obj $(LIB)
strip:
@true