# # gcc Makefile for ld65 # # ------------------------------------------------------------------------------ # The executable to build EXE = ld65 # Library dir COMMON = ../common # The linker library search path. Default is "/usr/lib/cc65/lib/" if nothing # is defined. You may use CC65_LIB=foo on the command line to override it. CC65_LIB = \"/usr/lib/cc65/lib/\" # CFLAGS = -g -O2 -Wall -W -std=c89 -I$(COMMON) -DCC65_LIB=$(CC65_LIB) CC=gcc EBIND=emxbind LDFLAGS= # Perl script for config file conversion CVT=cfg/cvt-cfg.pl # ----------------------------------------------------------------------------- # List of all object files OBJS = asserts.o \ bin.o \ binfmt.o \ cfgexpr.o \ condes.o \ config.o \ dbgfile.o \ dbginfo.o \ dbgsyms.o \ error.o \ exports.o \ expr.o \ extsyms.o \ fileinfo.o \ fileio.o \ filepath.o \ fragment.o \ global.o \ library.o \ lineinfo.o \ main.o \ mapfile.o \ o65.o \ objdata.o \ objfile.o \ scanner.o \ segments.o \ spool.o \ tgtcfg.o # ----------------------------------------------------------------------------- # List of all config includes INCS = apple2.inc \ apple2enh.inc \ atari.inc \ atmos.inc \ bbc.inc \ c128.inc \ c16.inc \ c64.inc \ cbm510.inc \ cbm610.inc \ geos.inc \ lunix.inc \ lynx.inc \ module.inc \ nes.inc \ none.inc \ pet.inc \ plus4.inc \ supervision.inc \ vic20.inc 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): $(INCS) $(OBJS) $(LIBS) $(CC) $(OBJS) $(LIBS) $(LDFLAGS) -o $@ @if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi clean: $(RM) *~ core.* *.map zap: clean $(RM) *.o $(INCS) $(EXE) .depend # ------------------------------------------------------------------------------ # Make the dependencies .PHONY: depend dep depend dep: $(OBJS:.o=.c) @echo "Creating dependency information" $(CC) $(CFLAGS) -MM -MG $^ > .depend # ----------------------------------------------------------------------------- # Rules to make config includes apple2.inc: cfg/apple2.cfg @$(CVT) $< $@ CfgApple2 # The apple2enh target uses the same config as the apple2 apple2enh.inc: cfg/apple2.cfg @$(CVT) $< $@ CfgApple2Enh atari.inc: cfg/atari.cfg @$(CVT) $< $@ CfgAtari atmos.inc: cfg/atmos.cfg @$(CVT) $< $@ CfgAtmos bbc.inc: cfg/bbc.cfg @$(CVT) $< $@ CfgBBC c16.inc: cfg/c16.cfg @$(CVT) $< $@ CfgC16 c64.inc: cfg/c64.cfg @$(CVT) $< $@ CfgC64 c128.inc: cfg/c128.cfg @$(CVT) $< $@ CfgC128 cbm510.inc: cfg/cbm510.cfg @$(CVT) $< $@ CfgCBM510 cbm610.inc: cfg/cbm610.cfg @$(CVT) $< $@ CfgCBM610 geos.inc: cfg/geos.cfg @$(CVT) $< $@ CfgGeos lunix.inc: cfg/lunix.cfg @$(CVT) $< $@ CfgLunix lynx.inc: cfg/lynx.cfg @$(CVT) $< $@ CfgLynx module.inc: cfg/module.cfg @$(CVT) $< $@ CfgModule nes.inc: cfg/nes.cfg @$(CVT) $< $@ CfgNES none.inc: cfg/none.cfg @$(CVT) $< $@ CfgNone pet.inc: cfg/pet.cfg @$(CVT) $< $@ CfgPET plus4.inc: cfg/plus4.cfg @$(CVT) $< $@ CfgPlus4 supervision.inc: cfg/supervision.cfg @$(CVT) $< $@ CfgSupervision vic20.inc: cfg/vic20.cfg @$(CVT) $< $@ CfgVic20