aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Lohoff <flo@rfc822.org>2008-10-04 12:15:43 +0000
committerGuido G√ľnther <agx@sigxcpu.org>2009-01-11 18:11:50 +0100
commit9b278b0264d12e3a9c2b5468fd3333fad1fb45f5 (patch)
tree55dbc389f531d2e4db3cce738d8056d8e3b44b17
parent0b1d5fa90eabd98e3d69734ce1cdcef949d3fb30 (diff)
Remove print_loadaddr and print_outputformat
replace by makefile defines
-rw-r--r--Makefile15
-rw-r--r--common/Makefile9
-rw-r--r--common/print_loadaddr.c30
-rwxr-xr-xcommon/print_outputformat9
-rw-r--r--ext2load/Makefile8
-rw-r--r--tip22/Makefile8
6 files changed, 23 insertions, 56 deletions
diff --git a/Makefile b/Makefile
index 1c880d5..4bfb897 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,19 @@
# default subarch
SUBARCH ?= IP22
+ifeq ($(SUBARCH),IP22)
+KERNELADDR=0x88002000
+MAXLOADSIZE=0x1700000
+LOADADDR=0x88802000
+OUTPUTFORMAT=ecoff-bigmips
+endif
+ifeq ($(SUBARCH),IP32)
+KERNELADDR=0x80004000
+MAXLOADSIZE=0x1400000
+LOADADDR=0x81404000
+OUTPUTFORMAT=elf32-tradbigmips
+endif
+
# these contain subarch independent files
SUBARCH_INDEP_DIRS= \
arclib \
@@ -50,7 +63,7 @@ $(call dep-tgt,clean)
endef
define submake
-@$(MAKE) -C $(1) SUBARCH=$(SUBARCH) $(2)
+@$(MAKE) -C $(1) SUBARCH=$(SUBARCH) LOADADDR=$(LOADADDR) MAXLOADSIZE=$(MAXLOADSIZE) KERNELADDR=$(KERNELADDR) OUTPUTFORMAT=$(OUTPUTFORMAT) $(2)
endef
diff --git a/common/Makefile b/common/Makefile
index 2f160e3..f1f75ca 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -5,12 +5,7 @@ CFLAGS += -Wall -O2 -I. -I../arclib -DSUBARCH=${SUBARCH}
HOSTCC = $(CC)
HOSTCFLAGS += -Wall -O2 -DSUBARCH=$(SUBARCH)
-all: print_loadaddr
-
-print_loadaddr: print_loadaddr.c subarch.h version.h
- $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
-
-install: print_loadaddr
+all:
clean:
- rm -f print_loadaddr *~ tags
+ rm -f *~ tags
diff --git a/common/print_loadaddr.c b/common/print_loadaddr.c
deleted file mode 100644
index 17d648d..0000000
--- a/common/print_loadaddr.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* small helper to get the current subarch's loaddr */
-
-#include <stdio.h>
-#include <stdint.h>
-#include <strings.h>
-
-#include "subarch.h"
-
-int main(int argc, char *argv[])
-{
- int subarch = SUBARCH;
-
- if (argc == 2) {
- if (!strcasecmp(argv[1], "ip22"))
- subarch = IP22;
- else if (!strcasecmp(argv[1], "ip32"))
- subarch = IP32;
- else {
- fprintf(stderr,
- "Unknown subarchitecture %s requested\n",
- argv[1]);
- return 1;
- }
- }
-
- printf("%#08x\n", kernel_load[subarch].base
- + kernel_load[subarch].reserved);
-
- return 0;
-}
diff --git a/common/print_outputformat b/common/print_outputformat
deleted file mode 100755
index 5593a3c..0000000
--- a/common/print_outputformat
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-# default to ecoff
-
-case $1 in
- ip32 | IP32) echo "elf32-tradbigmips" ;;
- ip22 | IP22) echo "ecoff-bigmips" ;;
- *) echo "ecoff-bigmips" ;;
-esac
diff --git a/ext2load/Makefile b/ext2load/Makefile
index aef477e..f39ea51 100644
--- a/ext2load/Makefile
+++ b/ext2load/Makefile
@@ -36,10 +36,10 @@ ext2load: $(OBJECTS) $(LIBS) ld.script ../common/subarch.h
$(LD) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
ld.script: ld.script.in
- $(MAKE) -C ../common SUBARCH=$(SUBARCH) print_loadaddr
- LOADADDR=$$(../common/print_loadaddr $(SUBARCH)); \
- OUTPUTFORMAT=$$(../common/print_outputformat $(SUBARCH)); \
- sed -e "s/@@LOADADDR@@/$$LOADADDR/" \
+ $(MAKE) -C ../common SUBARCH=$(SUBARCH)
+ LOADADDR=$(LOADADDR); \
+ OUTPUTFORMAT=$(OUTPUTFORMAT); \
+ sed -e "s/@@LOADADDR@@/$$LOADADDR/" \
-e "s/@@OUTPUTFORMAT@@/$$OUTPUTFORMAT/" <$< >$@
install:
diff --git a/tip22/Makefile b/tip22/Makefile
index 2efe8ae..548371b 100644
--- a/tip22/Makefile
+++ b/tip22/Makefile
@@ -6,8 +6,6 @@ ARCLIBDIR = ../arclib
ARCLIB = $(ARCLIBDIR)/libarc.a
COMMONDIR = ../common
-PRINT_LOADADDR = $(COMMONDIR)/print_loadaddr
-PRINT_OUTPUTFORMAT = $(COMMONDIR)/print_outputformat
CFLAGS += -O2 -I$(COMMONDIR) -I$(ARCLIBDIR) -Wall -mno-abicalls -G 0 \
-fno-pic -DSUBARCH=${SUBARCH}
@@ -44,9 +42,9 @@ $(PRINT_LOADADDR):
%.$(SUBARCH).o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
-%.script.$(SUBARCH): %.script.in $(PRINT_LOADADDR) $(PRINT_OUTPUTFORMAT)
- LOADADDR=$$($(PRINT_LOADADDR) $(SUBARCH)); \
- OUTPUTFORMAT=$$($(PRINT_OUTPUTFORMAT) $(SUBARCH)); \
+%.script.$(SUBARCH): %.script.in
+ LOADADDR=$(LOADADDR); \
+ OUTPUTFORMAT=$(OUTPUTFORMAT); \
sed -e "s/@@LOADADDR@@/$$LOADADDR/" \
-e "s/@@OUTPUTFORMAT@@/$$OUTPUTFORMAT/" <$< >$@