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,102 +0,0 @@
#
# gcc Makefile for ca65
#
# ------------------------------------------------------------------------------
# The executable to build
EXE = ca65
# Library dir
COMMON = ../common
# Several search paths. You may redefine these on the command line
CA65_INC = \"/usr/lib/cc65/asminc/\"
#
CC = gcc
CFLAGS = -g -O2 -Wall -W -std=c89
override CFLAGS += -I$(COMMON)
override CFLAGS += -DCA65_INC=$(CA65_INC)
EBIND = emxbind
LDFLAGS =
# -----------------------------------------------------------------------------
# List of all object files
OBJS = anonname.o \
asserts.o \
condasm.o \
dbginfo.o \
ea65.o \
easw16.o \
enum.o \
error.o \
expr.o \
feature.o \
filetab.o \
fragment.o \
global.o \
incpath.o \
instr.o \
istack.o \
lineinfo.o \
listing.o \
macro.o \
main.o \
nexttok.o \
objcode.o \
objfile.o \
options.o \
pseudo.o \
repeat.o \
scanner.o \
segdef.o \
segment.o \
sizeof.o \
span.o \
spool.o \
struct.o \
studyexpr.o \
symentry.o \
symbol.o \
symtab.o \
token.o \
toklist.o \
ulabel.o
# -----------------------------------------------------------------------------
# List of all macro files
LIBS = $(COMMON)/common.a
# ------------------------------------------------------------------------------
# Makefile targets
# Main target - must be first
.PHONY: all
ifeq (.depend,$(wildcard .depend))
all: $(EXE)
include .depend
else
all: depend
@$(MAKE) -f make/gcc.mak all
endif
$(EXE): $(OBJS) $(LIBS)
$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
@if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi
clean:
$(RM) *~ core.* *.map
zap: clean
$(RM) *.o $(EXE) .depend
# ------------------------------------------------------------------------------
# Make the dependencies
.PHONY: depend dep
depend dep: $(INCS) $(OBJS:.o=.c)
@echo "Creating dependency information"
$(CC) $(CFLAGS) -MM $(OBJS:.o=.c) > .depend

View File

@@ -1,137 +0,0 @@
#
# CA65 Makefile for the Watcom compiler (using GNU make)
#
# ------------------------------------------------------------------------------
# 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
WSTRIP = $(WINE) wstrip -q
LNKCFG = ld.tmp
# Program arguments
CFLAGS = -d1 -obeilr -zp4 -5 -zq -w2 -i=..\\common
# Target files
EXE = ca65.exe
# 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 = anonname.obj \
asserts.obj \
condasm.obj \
dbginfo.obj \
ea65.obj \
easw16.obj \
enum.obj \
error.obj \
expr.obj \
feature.obj \
filetab.obj \
fragment.obj \
global.obj \
incpath.obj \
instr.obj \
istack.obj \
lineinfo.obj \
listing.obj \
macpack.obj \
macro.obj \
main.obj \
nexttok.obj \
objcode.obj \
objfile.obj \
options.obj \
pseudo.obj \
repeat.obj \
scanner.obj \
segdef.obj \
segment.obj \
sizeof.obj \
span.obj \
spool.obj \
struct.obj \
studyexpr.obj \
symbol.obj \
symentry.obj \
symtab.obj \
token.obj \
toklist.obj \
ulabel.obj
LIBS = ../common/common.lib
# ------------------------------------------------------------------------------
# Main targets
all: $(EXE)
# ------------------------------------------------------------------------------
# Other targets
$(EXE): $(OBJS) $(LIBS)
@echo "DEBUG ALL" > $(LNKCFG)
@echo "OPTION QUIET" >> $(LNKCFG)
@echo "OPTION MAP" >> $(LNKCFG)
@echo "OPTION STACK=65536" >> $(LNKCFG)
@echo "NAME $@" >> $(LNKCFG)
@for i in $(OBJS); do echo "FILE $${i}"; done >> $(LNKCFG)
@for i in $(LIBS); do echo "LIBRARY $${i}"; done >> $(LNKCFG)
@$(LD) system $(SYSTEM) @$(LNKCFG)
@rm $(LNKCFG)
clean:
@rm -f *~ core
zap: clean
@rm -f $(OBJS) $(EXE) $(EXE:.exe=.map)
strip:
@-$(WSTRIP) $(EXE)