From 37c492b544dec2460fc2c16a3d66275cc0d4edc0 Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Tue, 9 Apr 2013 23:09:46 +0200
Subject: [PATCH] Replaced builtin linker configs with ordinary .cfg files.
The benefits are:
- Independency of ld65 build from perl
- More transparent behaviour
---
{src/ld65/cfg => cfg}/apple2-asm.cfg | 0
{src/ld65/cfg => cfg}/apple2-overlay.cfg | 0
{src/ld65/cfg => cfg}/apple2-system.cfg | 0
{src/ld65/cfg => cfg}/apple2.cfg | 0
{src/ld65/cfg => cfg}/apple2enh-asm.cfg | 0
{src/ld65/cfg => cfg}/apple2enh-overlay.cfg | 0
{src/ld65/cfg => cfg}/apple2enh-system.cfg | 0
{src/ld65/cfg => cfg}/apple2enh.cfg | 0
{src/ld65/cfg => cfg}/atari-overlay.cfg | 0
{src/ld65/cfg => cfg}/atari.cfg | 0
{src/ld65/cfg => cfg}/atmos.cfg | 0
{src/ld65/cfg => cfg}/bbc.cfg | 0
{src/ld65/cfg => cfg}/c128-overlay.cfg | 0
{src/ld65/cfg => cfg}/c128.cfg | 0
{src/ld65/cfg => cfg}/c16.cfg | 0
{src/ld65/cfg => cfg}/c64-asm.cfg | 0
{src/ld65/cfg => cfg}/c64-overlay.cfg | 0
{src/ld65/cfg => cfg}/c64.cfg | 0
{src/ld65/cfg => cfg}/cbm510.cfg | 0
{src/ld65/cfg => cfg}/cbm610.cfg | 0
{src/ld65/cfg => cfg}/geos-apple.cfg | 0
{src/ld65/cfg => cfg}/geos-cbm.cfg | 0
{src/ld65/cfg => cfg}/lunix.cfg | 0
{src/ld65/cfg => cfg}/lynx-bll.cfg | 0
{src/ld65/cfg => cfg}/lynx-coll.cfg | 0
{src/ld65/cfg => cfg}/lynx-uploader.cfg | 0
{src/ld65/cfg => cfg}/lynx.cfg | 0
{src/ld65/cfg => cfg}/module.cfg | 0
{src/ld65/cfg => cfg}/nes.cfg | 0
{src/ld65/cfg => cfg}/none.cfg | 0
{src/ld65/cfg => cfg}/pet.cfg | 0
{src/ld65/cfg => cfg}/plus4.cfg | 0
{src/ld65/cfg => cfg}/supervision-128k.cfg | 0
{src/ld65/cfg => cfg}/supervision-16k.cfg | 0
{src/ld65/cfg => cfg}/supervision-64k.cfg | 0
{src/ld65/cfg => cfg}/supervision.cfg | 0
{src/ld65/cfg => cfg}/vic20-32k.cfg | 0
{src/ld65/cfg => cfg}/vic20.cfg | 0
src/common/target.c | 42 +++----
src/common/target.h | 7 +-
src/ld65/binfmt.c | 4 +
src/ld65/binfmt.h | 5 -
src/ld65/cfg/cvt-cfg.pl | 67 -----------
src/ld65/config.c | 1 +
src/ld65/main.c | 43 +++----
src/ld65/make/gcc.mak | 99 +--------------
src/ld65/tgtcfg.c | 127 --------------------
src/ld65/tgtcfg.h | 81 -------------
48 files changed, 52 insertions(+), 424 deletions(-)
rename {src/ld65/cfg => cfg}/apple2-asm.cfg (100%)
rename {src/ld65/cfg => cfg}/apple2-overlay.cfg (100%)
rename {src/ld65/cfg => cfg}/apple2-system.cfg (100%)
rename {src/ld65/cfg => cfg}/apple2.cfg (100%)
rename {src/ld65/cfg => cfg}/apple2enh-asm.cfg (100%)
rename {src/ld65/cfg => cfg}/apple2enh-overlay.cfg (100%)
rename {src/ld65/cfg => cfg}/apple2enh-system.cfg (100%)
rename {src/ld65/cfg => cfg}/apple2enh.cfg (100%)
rename {src/ld65/cfg => cfg}/atari-overlay.cfg (100%)
rename {src/ld65/cfg => cfg}/atari.cfg (100%)
rename {src/ld65/cfg => cfg}/atmos.cfg (100%)
rename {src/ld65/cfg => cfg}/bbc.cfg (100%)
rename {src/ld65/cfg => cfg}/c128-overlay.cfg (100%)
rename {src/ld65/cfg => cfg}/c128.cfg (100%)
rename {src/ld65/cfg => cfg}/c16.cfg (100%)
rename {src/ld65/cfg => cfg}/c64-asm.cfg (100%)
rename {src/ld65/cfg => cfg}/c64-overlay.cfg (100%)
rename {src/ld65/cfg => cfg}/c64.cfg (100%)
rename {src/ld65/cfg => cfg}/cbm510.cfg (100%)
rename {src/ld65/cfg => cfg}/cbm610.cfg (100%)
rename {src/ld65/cfg => cfg}/geos-apple.cfg (100%)
rename {src/ld65/cfg => cfg}/geos-cbm.cfg (100%)
rename {src/ld65/cfg => cfg}/lunix.cfg (100%)
rename {src/ld65/cfg => cfg}/lynx-bll.cfg (100%)
rename {src/ld65/cfg => cfg}/lynx-coll.cfg (100%)
rename {src/ld65/cfg => cfg}/lynx-uploader.cfg (100%)
rename {src/ld65/cfg => cfg}/lynx.cfg (100%)
rename {src/ld65/cfg => cfg}/module.cfg (100%)
rename {src/ld65/cfg => cfg}/nes.cfg (100%)
rename {src/ld65/cfg => cfg}/none.cfg (100%)
rename {src/ld65/cfg => cfg}/pet.cfg (100%)
rename {src/ld65/cfg => cfg}/plus4.cfg (100%)
rename {src/ld65/cfg => cfg}/supervision-128k.cfg (100%)
rename {src/ld65/cfg => cfg}/supervision-16k.cfg (100%)
rename {src/ld65/cfg => cfg}/supervision-64k.cfg (100%)
rename {src/ld65/cfg => cfg}/supervision.cfg (100%)
rename {src/ld65/cfg => cfg}/vic20-32k.cfg (100%)
rename {src/ld65/cfg => cfg}/vic20.cfg (100%)
delete mode 100755 src/ld65/cfg/cvt-cfg.pl
delete mode 100644 src/ld65/tgtcfg.c
delete mode 100644 src/ld65/tgtcfg.h
diff --git a/src/ld65/cfg/apple2-asm.cfg b/cfg/apple2-asm.cfg
similarity index 100%
rename from src/ld65/cfg/apple2-asm.cfg
rename to cfg/apple2-asm.cfg
diff --git a/src/ld65/cfg/apple2-overlay.cfg b/cfg/apple2-overlay.cfg
similarity index 100%
rename from src/ld65/cfg/apple2-overlay.cfg
rename to cfg/apple2-overlay.cfg
diff --git a/src/ld65/cfg/apple2-system.cfg b/cfg/apple2-system.cfg
similarity index 100%
rename from src/ld65/cfg/apple2-system.cfg
rename to cfg/apple2-system.cfg
diff --git a/src/ld65/cfg/apple2.cfg b/cfg/apple2.cfg
similarity index 100%
rename from src/ld65/cfg/apple2.cfg
rename to cfg/apple2.cfg
diff --git a/src/ld65/cfg/apple2enh-asm.cfg b/cfg/apple2enh-asm.cfg
similarity index 100%
rename from src/ld65/cfg/apple2enh-asm.cfg
rename to cfg/apple2enh-asm.cfg
diff --git a/src/ld65/cfg/apple2enh-overlay.cfg b/cfg/apple2enh-overlay.cfg
similarity index 100%
rename from src/ld65/cfg/apple2enh-overlay.cfg
rename to cfg/apple2enh-overlay.cfg
diff --git a/src/ld65/cfg/apple2enh-system.cfg b/cfg/apple2enh-system.cfg
similarity index 100%
rename from src/ld65/cfg/apple2enh-system.cfg
rename to cfg/apple2enh-system.cfg
diff --git a/src/ld65/cfg/apple2enh.cfg b/cfg/apple2enh.cfg
similarity index 100%
rename from src/ld65/cfg/apple2enh.cfg
rename to cfg/apple2enh.cfg
diff --git a/src/ld65/cfg/atari-overlay.cfg b/cfg/atari-overlay.cfg
similarity index 100%
rename from src/ld65/cfg/atari-overlay.cfg
rename to cfg/atari-overlay.cfg
diff --git a/src/ld65/cfg/atari.cfg b/cfg/atari.cfg
similarity index 100%
rename from src/ld65/cfg/atari.cfg
rename to cfg/atari.cfg
diff --git a/src/ld65/cfg/atmos.cfg b/cfg/atmos.cfg
similarity index 100%
rename from src/ld65/cfg/atmos.cfg
rename to cfg/atmos.cfg
diff --git a/src/ld65/cfg/bbc.cfg b/cfg/bbc.cfg
similarity index 100%
rename from src/ld65/cfg/bbc.cfg
rename to cfg/bbc.cfg
diff --git a/src/ld65/cfg/c128-overlay.cfg b/cfg/c128-overlay.cfg
similarity index 100%
rename from src/ld65/cfg/c128-overlay.cfg
rename to cfg/c128-overlay.cfg
diff --git a/src/ld65/cfg/c128.cfg b/cfg/c128.cfg
similarity index 100%
rename from src/ld65/cfg/c128.cfg
rename to cfg/c128.cfg
diff --git a/src/ld65/cfg/c16.cfg b/cfg/c16.cfg
similarity index 100%
rename from src/ld65/cfg/c16.cfg
rename to cfg/c16.cfg
diff --git a/src/ld65/cfg/c64-asm.cfg b/cfg/c64-asm.cfg
similarity index 100%
rename from src/ld65/cfg/c64-asm.cfg
rename to cfg/c64-asm.cfg
diff --git a/src/ld65/cfg/c64-overlay.cfg b/cfg/c64-overlay.cfg
similarity index 100%
rename from src/ld65/cfg/c64-overlay.cfg
rename to cfg/c64-overlay.cfg
diff --git a/src/ld65/cfg/c64.cfg b/cfg/c64.cfg
similarity index 100%
rename from src/ld65/cfg/c64.cfg
rename to cfg/c64.cfg
diff --git a/src/ld65/cfg/cbm510.cfg b/cfg/cbm510.cfg
similarity index 100%
rename from src/ld65/cfg/cbm510.cfg
rename to cfg/cbm510.cfg
diff --git a/src/ld65/cfg/cbm610.cfg b/cfg/cbm610.cfg
similarity index 100%
rename from src/ld65/cfg/cbm610.cfg
rename to cfg/cbm610.cfg
diff --git a/src/ld65/cfg/geos-apple.cfg b/cfg/geos-apple.cfg
similarity index 100%
rename from src/ld65/cfg/geos-apple.cfg
rename to cfg/geos-apple.cfg
diff --git a/src/ld65/cfg/geos-cbm.cfg b/cfg/geos-cbm.cfg
similarity index 100%
rename from src/ld65/cfg/geos-cbm.cfg
rename to cfg/geos-cbm.cfg
diff --git a/src/ld65/cfg/lunix.cfg b/cfg/lunix.cfg
similarity index 100%
rename from src/ld65/cfg/lunix.cfg
rename to cfg/lunix.cfg
diff --git a/src/ld65/cfg/lynx-bll.cfg b/cfg/lynx-bll.cfg
similarity index 100%
rename from src/ld65/cfg/lynx-bll.cfg
rename to cfg/lynx-bll.cfg
diff --git a/src/ld65/cfg/lynx-coll.cfg b/cfg/lynx-coll.cfg
similarity index 100%
rename from src/ld65/cfg/lynx-coll.cfg
rename to cfg/lynx-coll.cfg
diff --git a/src/ld65/cfg/lynx-uploader.cfg b/cfg/lynx-uploader.cfg
similarity index 100%
rename from src/ld65/cfg/lynx-uploader.cfg
rename to cfg/lynx-uploader.cfg
diff --git a/src/ld65/cfg/lynx.cfg b/cfg/lynx.cfg
similarity index 100%
rename from src/ld65/cfg/lynx.cfg
rename to cfg/lynx.cfg
diff --git a/src/ld65/cfg/module.cfg b/cfg/module.cfg
similarity index 100%
rename from src/ld65/cfg/module.cfg
rename to cfg/module.cfg
diff --git a/src/ld65/cfg/nes.cfg b/cfg/nes.cfg
similarity index 100%
rename from src/ld65/cfg/nes.cfg
rename to cfg/nes.cfg
diff --git a/src/ld65/cfg/none.cfg b/cfg/none.cfg
similarity index 100%
rename from src/ld65/cfg/none.cfg
rename to cfg/none.cfg
diff --git a/src/ld65/cfg/pet.cfg b/cfg/pet.cfg
similarity index 100%
rename from src/ld65/cfg/pet.cfg
rename to cfg/pet.cfg
diff --git a/src/ld65/cfg/plus4.cfg b/cfg/plus4.cfg
similarity index 100%
rename from src/ld65/cfg/plus4.cfg
rename to cfg/plus4.cfg
diff --git a/src/ld65/cfg/supervision-128k.cfg b/cfg/supervision-128k.cfg
similarity index 100%
rename from src/ld65/cfg/supervision-128k.cfg
rename to cfg/supervision-128k.cfg
diff --git a/src/ld65/cfg/supervision-16k.cfg b/cfg/supervision-16k.cfg
similarity index 100%
rename from src/ld65/cfg/supervision-16k.cfg
rename to cfg/supervision-16k.cfg
diff --git a/src/ld65/cfg/supervision-64k.cfg b/cfg/supervision-64k.cfg
similarity index 100%
rename from src/ld65/cfg/supervision-64k.cfg
rename to cfg/supervision-64k.cfg
diff --git a/src/ld65/cfg/supervision.cfg b/cfg/supervision.cfg
similarity index 100%
rename from src/ld65/cfg/supervision.cfg
rename to cfg/supervision.cfg
diff --git a/src/ld65/cfg/vic20-32k.cfg b/cfg/vic20-32k.cfg
similarity index 100%
rename from src/ld65/cfg/vic20-32k.cfg
rename to cfg/vic20-32k.cfg
diff --git a/src/ld65/cfg/vic20.cfg b/cfg/vic20.cfg
similarity index 100%
rename from src/ld65/cfg/vic20.cfg
rename to cfg/vic20.cfg
diff --git a/src/common/target.c b/src/common/target.c
index 2d1eb60b3..79c9f8555 100644
--- a/src/common/target.c
+++ b/src/common/target.c
@@ -151,27 +151,27 @@ static const TargetEntry TargetMap[] = {
/* Table with target properties by target id */
static const TargetProperties PropertyTable[TGT_COUNT] = {
- { "none", CPU_6502, CTNone },
- { "module", CPU_6502, CTNone },
- { "atari", CPU_6502, CTAtari },
- { "vic20", CPU_6502, CTPET },
- { "c16", CPU_6502, CTPET },
- { "c64", CPU_6502, CTPET },
- { "c128", CPU_6502, CTPET },
- { "plus4", CPU_6502, CTPET },
- { "cbm510", CPU_6502, CTPET },
- { "cbm610", CPU_6502, CTPET },
- { "pet", CPU_6502, CTPET },
- { "bbc", CPU_6502, CTNone },
- { "apple2", CPU_6502, CTNone },
- { "apple2enh", CPU_65C02, CTNone },
- { "geos-cbm", CPU_6502, CTNone },
- { "geos-apple", CPU_65C02, CTNone },
- { "lunix", CPU_6502, CTNone },
- { "atmos", CPU_6502, CTNone },
- { "nes", CPU_6502, CTNone },
- { "supervision", CPU_65SC02, CTNone },
- { "lynx", CPU_65C02, CTNone },
+ { "none", CPU_6502, BINFMT_BINARY, CTNone },
+ { "module", CPU_6502, BINFMT_O65, CTNone },
+ { "atari", CPU_6502, BINFMT_BINARY, CTAtari },
+ { "vic20", CPU_6502, BINFMT_BINARY, CTPET },
+ { "c16", CPU_6502, BINFMT_BINARY, CTPET },
+ { "c64", CPU_6502, BINFMT_BINARY, CTPET },
+ { "c128", CPU_6502, BINFMT_BINARY, CTPET },
+ { "plus4", CPU_6502, BINFMT_BINARY, CTPET },
+ { "cbm510", CPU_6502, BINFMT_BINARY, CTPET },
+ { "cbm610", CPU_6502, BINFMT_BINARY, CTPET },
+ { "pet", CPU_6502, BINFMT_BINARY, CTPET },
+ { "bbc", CPU_6502, BINFMT_BINARY, CTNone },
+ { "apple2", CPU_6502, BINFMT_BINARY, CTNone },
+ { "apple2enh", CPU_65C02, BINFMT_BINARY, CTNone },
+ { "geos-cbm", CPU_6502, BINFMT_BINARY, CTNone },
+ { "geos-apple", CPU_65C02, BINFMT_BINARY, CTNone },
+ { "lunix", CPU_6502, BINFMT_O65, CTNone },
+ { "atmos", CPU_6502, BINFMT_BINARY, CTNone },
+ { "nes", CPU_6502, BINFMT_BINARY, CTNone },
+ { "supervision", CPU_65SC02, BINFMT_BINARY, CTNone },
+ { "lynx", CPU_65C02, BINFMT_BINARY, CTNone },
};
/* Target system */
diff --git a/src/common/target.h b/src/common/target.h
index fa1d42964..0ac5564e5 100644
--- a/src/common/target.h
+++ b/src/common/target.h
@@ -81,14 +81,17 @@ typedef struct TargetProperties TargetProperties;
struct TargetProperties {
const char Name[12]; /* Name of the target */
cpu_t DefaultCPU; /* Default CPU for this target */
+ unsigned char BinFmt; /* Default binary format for this target */
const unsigned char* CharMap; /* Character translation table */
};
/* Target system */
extern target_t Target;
-/* Table with default CPUs per target */
-extern const cpu_t DefaultCPU[TGT_COUNT];
+/* Types of available output formats */
+#define BINFMT_DEFAULT 0 /* Default (binary) */
+#define BINFMT_BINARY 1 /* Straight binary format */
+#define BINFMT_O65 2 /* Andre Fachats o65 format */
diff --git a/src/ld65/binfmt.c b/src/ld65/binfmt.c
index b7c978475..3419cd063 100644
--- a/src/ld65/binfmt.c
+++ b/src/ld65/binfmt.c
@@ -33,6 +33,10 @@
+/* common */
+#include "target.h"
+
+/* ld65 */
#include "error.h"
#include "binfmt.h"
diff --git a/src/ld65/binfmt.h b/src/ld65/binfmt.h
index f5414172d..493bd7fea 100644
--- a/src/ld65/binfmt.h
+++ b/src/ld65/binfmt.h
@@ -44,11 +44,6 @@
-/* Types of available output formats */
-#define BINFMT_DEFAULT 0 /* Default (binary) */
-#define BINFMT_BINARY 1 /* Straight binary format */
-#define BINFMT_O65 2 /* Andre Fachats o65 format */
-
/* Default format (depends on target system) */
extern unsigned char DefaultBinFmt;
diff --git a/src/ld65/cfg/cvt-cfg.pl b/src/ld65/cfg/cvt-cfg.pl
deleted file mode 100755
index c02c2a7d9..000000000
--- a/src/ld65/cfg/cvt-cfg.pl
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/perl
-
-# Check number of params
-die "Usage: cvt-cfg.pl input output varname\n" unless ($#ARGV == 2);
-
-# Get the parameters
-$InputName = shift (@ARGV);
-$OutputName = shift (@ARGV);
-$VarName = shift (@ARGV);
-
-# Open both files
-open (IN, "<$InputName") or die "Cannot open $InputName\n";
-open (OUT, ">$OutputName") or die "Cannot open $OutputName\n";
-
-# Print the header to the output file
-print OUT "static const char $VarName [] = \n";
-
-# Read from input, print to output
-while ($Line = ) {
-
- # Remove the newline
- chomp $Line;
-
- # Separate an existing comment. No need to be overly clever, just ignore
- # hash marks in strings.
- if ($Line =~ /(.*?)(\s*)(\#\s*)(.*?)\s*$/) {
- $Line = $1;
- $CommentSpace = $2;
- $Comment = $4;
- } else {
- $CommentSpace = "";
- $Comment = "";
- }
-
- # Remove leading and trailing spaces
- $Line =~ s/^\s*|\s*$//g;
-
- # Replace control chars
- $Line =~ s/\\/\\\\/g;
- $Line =~ s/\"/\\\"/g;
- $Line =~ s/\'/\\\'/g;
-
- # Print to output
- print OUT "\"$Line\\n\"";
-
- # Add a comment if we have one
- if ($Comment ne "") {
- print OUT "$CommentSpace/* $Comment */";
- }
-
- # Terminate the line
- print OUT "\n";
-}
-
-# Terminate the variable declaration
-print OUT ";\n";
-
-# Close the files
-close IN;
-close OUT;
-
-# Done
-exit 0;
-
-
-
-
diff --git a/src/ld65/config.c b/src/ld65/config.c
index 4aaa7d99d..70fa63b54 100644
--- a/src/ld65/config.c
+++ b/src/ld65/config.c
@@ -48,6 +48,7 @@
#include "check.h"
#include "print.h"
#include "segdefs.h"
+#include "target.h"
#include "xmalloc.h"
#include "xsprintf.h"
diff --git a/src/ld65/main.c b/src/ld65/main.c
index 6a0c09c06..45ab3493a 100644
--- a/src/ld65/main.c
+++ b/src/ld65/main.c
@@ -67,7 +67,6 @@
#include "scanner.h"
#include "segments.h"
#include "spool.h"
-#include "tgtcfg.h"
#include "tpool.h"
@@ -326,21 +325,6 @@ static void OptDefine (const char* Opt attribute ((unused)), const char* Arg)
-static void OptDumpConfig (const char* Opt attribute ((unused)), const char* Arg)
-/* Dump a builtin linker configuration */
-{
- /* Map the given target name to its id */
- target_t T = FindTarget (Arg);
- if (T == TGT_UNKNOWN) {
- Error ("Target system `%s' is unknown", Arg);
- }
-
- /* Dump the builtin configuration */
- DumpBuiltinConfig (stdout, T);
-}
-
-
-
static void OptEndGroup (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* End a library group */
@@ -486,7 +470,8 @@ static void OptStartGroup (const char* Opt attribute ((unused)),
static void OptTarget (const char* Opt attribute ((unused)), const char* Arg)
/* Set the target system */
{
- const TargetDesc* D;
+ StrBuf FileName = STATIC_STRBUF_INITIALIZER;
+ char* PathName;
/* Map the target name to a target id */
Target = FindTarget (Arg);
@@ -494,14 +479,25 @@ static void OptTarget (const char* Opt attribute ((unused)), const char* Arg)
Error ("Invalid target name: `%s'", Arg);
}
- /* Get the target description record */
- D = &Targets[Target];
+ /* Set the target binary format */
+ DefaultBinFmt = GetTargetProperties (Target)->BinFmt;
+
+ /* Build config file name from target name */
+ SB_CopyStr (&FileName, GetTargetName (Target));
+ SB_AppendStr (&FileName, ".cfg");
+ SB_Terminate (&FileName);
+
+ /* Search for the file */
+ PathName = SearchFile (CfgSearchPath, SB_GetBuf (&FileName));
+ if (PathName == 0) {
+ Error ("Cannot find config file `%s'", SB_GetBuf (&FileName));
+ }
- /* Set the target data */
- DefaultBinFmt = D->BinFmt;
- CfgSetBuf (D->Cfg);
+ /* Free file name memory */
+ SB_Done (&FileName);
- /* Read the target config */
+ /* Read the file */
+ CfgSetName (PathName);
CfgRead ();
}
@@ -527,7 +523,6 @@ int main (int argc, char* argv [])
{ "--config", 1, OptConfig },
{ "--dbgfile", 1, OptDbgFile },
{ "--define", 1, OptDefine },
- { "--dump-config", 1, OptDumpConfig },
{ "--end-group", 0, OptEndGroup },
{ "--force-import", 1, OptForceImport },
{ "--help", 0, OptHelp },
diff --git a/src/ld65/make/gcc.mak b/src/ld65/make/gcc.mak
index 4baf8708a..fe8428944 100644
--- a/src/ld65/make/gcc.mak
+++ b/src/ld65/make/gcc.mak
@@ -23,9 +23,6 @@ override CFLAGS += -DLD65_LIB=$(LD65_LIB) -DLD65_OBJ=$(LD65_OBJ) -DLD65_CFG=$(LD
EBIND = emxbind
LDFLAGS =
-# Perl script for config file conversion
-CVT=cfg/cvt-cfg.pl
-
# -----------------------------------------------------------------------------
# List of all object files
@@ -65,28 +62,6 @@ OBJS = asserts.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-apple.inc \
- geos-cbm.inc \
- lunix.inc \
- lynx.inc \
- module.inc \
- nes.inc \
- none.inc \
- pet.inc \
- plus4.inc \
- supervision.inc \
- vic20.inc
-
LIBS = $(COMMON)/common.a
@@ -103,12 +78,10 @@ all: depend
@$(MAKE) -f make/gcc.mak all
endif
-$(EXE): $(INCS) $(OBJS) $(LIBS)
+$(EXE): $(OBJS) $(LIBS)
$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
@if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi
-inc: $(INCS)
-
clean:
$(RM) *~ core.* *.map
@@ -119,74 +92,6 @@ zap: clean
# Make the dependencies
.PHONY: depend dep
-depend dep: $(INCS) $(OBJS:.o=.c)
+depend dep: $(OBJS:.o=.c)
@echo "Creating dependency information"
$(CC) $(CFLAGS) -MM $(OBJS:.o=.c) > .depend
-
-# -----------------------------------------------------------------------------
-# Rules to make config includes
-
-apple2.inc: cfg/apple2.cfg
- @$(CVT) $< $@ CfgApple2
-
-apple2enh.inc: cfg/apple2enh.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-apple.inc: cfg/geos-apple.cfg
- @$(CVT) $< $@ CfgGeosApple
-
-geos-cbm.inc: cfg/geos-cbm.cfg
- @$(CVT) $< $@ CfgGeosCBM
-
-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
-
-
diff --git a/src/ld65/tgtcfg.c b/src/ld65/tgtcfg.c
deleted file mode 100644
index 2601c20e4..000000000
--- a/src/ld65/tgtcfg.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*****************************************************************************/
-/* */
-/* tgtcfg.c */
-/* */
-/* Target machine configurations the ld65 linker */
-/* */
-/* */
-/* */
-/* (C) 1998-2009, Ullrich von Bassewitz */
-/* Roemerstrasse 52 */
-/* D-70794 Filderstadt */
-/* EMail: uz@cc65.org */
-/* */
-/* */
-/* This software is provided 'as-is', without any expressed or implied */
-/* warranty. In no event will the authors be held liable for any damages */
-/* arising from the use of this software. */
-/* */
-/* Permission is granted to anyone to use this software for any purpose, */
-/* including commercial applications, and to alter it and redistribute it */
-/* freely, subject to the following restrictions: */
-/* */
-/* 1. The origin of this software must not be misrepresented; you must not */
-/* claim that you wrote the original software. If you use this software */
-/* in a product, an acknowledgment in the product documentation would be */
-/* appreciated but is not required. */
-/* 2. Altered source versions must be plainly marked as such, and must not */
-/* be misrepresented as being the original software. */
-/* 3. This notice may not be removed or altered from any source */
-/* distribution. */
-/* */
-/*****************************************************************************/
-
-
-
-/* common */
-#include "check.h"
-
-/* ld65 */
-#include "binfmt.h"
-#include "tgtcfg.h"
-
-
-
-/*****************************************************************************/
-/* Target configurations */
-/*****************************************************************************/
-
-
-
-/* Actual target configurations, converted into C strings by a perl script */
-#include "apple2.inc"
-#include "apple2enh.inc"
-#include "atari.inc"
-#include "atmos.inc"
-#include "bbc.inc"
-#include "c128.inc"
-#include "c16.inc"
-#include "c64.inc"
-#include "cbm510.inc"
-#include "cbm610.inc"
-#include "geos-apple.inc"
-#include "geos-cbm.inc"
-#include "lunix.inc"
-#include "lynx.inc"
-#include "module.inc"
-#include "nes.inc"
-#include "none.inc"
-#include "pet.inc"
-#include "plus4.inc"
-#include "supervision.inc"
-#include "vic20.inc"
-
-
-
-/*****************************************************************************/
-/* Data */
-/*****************************************************************************/
-
-
-
-/* Target configurations for all systems */
-const TargetDesc Targets[TGT_COUNT] = {
- { BINFMT_BINARY, CfgNone },
- { BINFMT_O65, CfgModule },
- { BINFMT_BINARY, CfgAtari },
- { BINFMT_BINARY, CfgVic20 },
- { BINFMT_BINARY, CfgC16 },
- { BINFMT_BINARY, CfgC64 },
- { BINFMT_BINARY, CfgC128 },
- { BINFMT_BINARY, CfgPlus4 },
- { BINFMT_BINARY, CfgCBM510 },
- { BINFMT_BINARY, CfgCBM610 },
- { BINFMT_BINARY, CfgPET },
- { BINFMT_BINARY, CfgBBC },
- { BINFMT_BINARY, CfgApple2 },
- { BINFMT_BINARY, CfgApple2Enh },
- { BINFMT_BINARY, CfgGeosCBM },
- { BINFMT_BINARY, CfgGeosApple },
- { BINFMT_O65, CfgLunix },
- { BINFMT_BINARY, CfgAtmos },
- { BINFMT_BINARY, CfgNES },
- { BINFMT_BINARY, CfgSupervision },
- { BINFMT_BINARY, CfgLynx },
-};
-
-
-
-/*****************************************************************************/
-/* Code */
-/*****************************************************************************/
-
-
-
-void DumpBuiltinConfig (FILE* F, target_t T)
-/* Dump a builtin linker configuration */
-{
- /* Check the given parameter */
- PRECONDITION (T > TGT_UNKNOWN && T < TGT_COUNT);
-
- /* Dump the config */
- fprintf (F, "%s\n", Targets[T].Cfg);
-}
-
-
-
-
diff --git a/src/ld65/tgtcfg.h b/src/ld65/tgtcfg.h
deleted file mode 100644
index c37e2f313..000000000
--- a/src/ld65/tgtcfg.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*****************************************************************************/
-/* */
-/* tgtcfg.h */
-/* */
-/* Target machine configurations the ld65 linker */
-/* */
-/* */
-/* */
-/* (C) 1998-2003 Ullrich von Bassewitz */
-/* Römerstrasse 52 */
-/* D-70794 Filderstadt */
-/* EMail: uz@cc65.org */
-/* */
-/* */
-/* This software is provided 'as-is', without any expressed or implied */
-/* warranty. In no event will the authors be held liable for any damages */
-/* arising from the use of this software. */
-/* */
-/* Permission is granted to anyone to use this software for any purpose, */
-/* including commercial applications, and to alter it and redistribute it */
-/* freely, subject to the following restrictions: */
-/* */
-/* 1. The origin of this software must not be misrepresented; you must not */
-/* claim that you wrote the original software. If you use this software */
-/* in a product, an acknowledgment in the product documentation would be */
-/* appreciated but is not required. */
-/* 2. Altered source versions must be plainly marked as such, and must not */
-/* be misrepresented as being the original software. */
-/* 3. This notice may not be removed or altered from any source */
-/* distribution. */
-/* */
-/*****************************************************************************/
-
-
-
-#ifndef TGTCFG_H
-#define TGTCFG_H
-
-
-
-#include
-
-/* common */
-#include "target.h"
-
-
-
-/*****************************************************************************/
-/* Target configurations */
-/*****************************************************************************/
-
-
-
-/* Structure describing a target */
-typedef struct TargetDesc TargetDesc;
-struct TargetDesc {
- unsigned char BinFmt; /* Default binary format for the target */
- const char* Cfg; /* Pointer to configuration */
-};
-
-/* Target configurations for all systems */
-extern const TargetDesc Targets [TGT_COUNT];
-
-
-
-/*****************************************************************************/
-/* Code */
-/*****************************************************************************/
-
-
-
-void DumpBuiltinConfig (FILE* F, target_t T);
-/* Dump a builtin linker configuration */
-
-
-
-/* End of tgtcfg.h */
-#endif
-
-
-
--
2.39.5