[OpenBIOS] r761 - in cpu: ppc/Linux ppc/build x86/Linux
svn at openbios.org
svn at openbios.org
Thu Jan 3 00:28:13 CET 2008
Author: wmb
Date: 2008-01-03 00:28:13 +0100 (Thu, 03 Jan 2008)
New Revision: 761
Added:
cpu/ppc/build/Makefile
cpu/x86/Linux/Makefile.ppcforth
Modified:
cpu/ppc/Linux/Makefile
cpu/ppc/build/Makefile.cross
cpu/x86/Linux/Makefile
Log:
Improvements to the wrapper #define structure and the wrapper build scripts.
Modified: cpu/ppc/Linux/Makefile
===================================================================
--- cpu/ppc/Linux/Makefile 2008-01-02 21:41:48 UTC (rev 760)
+++ cpu/ppc/Linux/Makefile 2008-01-02 23:28:13 UTC (rev 761)
@@ -1,57 +1,36 @@
-# Flags for the simulator version
-WRAPPER = pforth
+# Makefile for native PowerPC wrapper to run under Linux
+
OPT = -O
# OPT =
BP=../../..
-CFLAGS = -DUNIX -DPPCSIM -DTARGET_POWERPC
+CFLAGS = -D__linux__ -DHOSTPOWERPC -DTARGET_POWERPC
CC = gcc
WRDIR = ${BP}/forth/wrapper
ZIPDIR = ${WRDIR}/zip
-SIMDIR = ../ppcsim
ZIPOBJS = zipmem.o deflate.o trees.o bits.o util.o inflate.o
-OBJS = wrapsim.o ppcsim.o logger.o ${ZIPOBJS}
-TRACEOBJS = wrapsim.o ppcsim.trace.o logger.o ${ZIPOBJS}
-SIMROMOBJS = simrom.o ppcsim.simrom.o
+OBJS = wrapper.o logger.o ${ZIPOBJS}
-all: ppcforth ppcforth.trace
+all: ppcforth
-ppcforth: $(OBJS)
+ppcforth: forth
+ ln -sf $< $@
+
+forth: $(OBJS)
$(CC) $(LFLAGS) $(OBJS) -o $@
-ppcforth.trace: $(TRACEOBJS)
- $(CC) $(LFLAGS) $(TRACEOBJS) -o $@
-
-simrom: $(SIMROMOBJS)
- $(CC) $(LFLAGS) $(SIMROMOBJS) -o $@
-
-wrapsim.o: ${WRDIR}/wrapper.c
- ${CC} -c ${CFLAGS} $< -o $@
-
%.o: ${WRDIR}/%.c
${CC} -c ${CFLAGS} $< -o $@
%.o: ${ZIPDIR}/%.c
${CC} -c ${CFLAGS} -I${ZIPDIR} $< -o $@
-ppcsim.o: $(SIMDIR)/ppcsim.c
- $(CC) $(OPT) $(CFLAGS) -DARGREGS -DSIMNEXT -c $< -o $@
-
-ppcsim.trace.o: $(SIMDIR)/ppcsim.c
- $(CC) $(OPT) $(CFLAGS) -DARGREGS -DSIMNEXT -DTRACE -c $< -o $@
-
-ppcsim.simrom.o: $(SIMDIR)/ppcsim.c
- $(CC) $(CFLAGS) -DARGREGS -DSIMNEXT -DTRACE -DSIMROM -c $< -o $@
-
-simrom.o: $(SIMDIR)/simrom.c
- $(CC) $(CFLAGS) -DARGREGS -DSIMNEXT -DTRACE -DSIMROM -c $< -o $@
-
clean:
- @rm -f *.o ppcforth ppcforth.trace
+ @rm -f *.o forth ppcforth
FRC:
Added: cpu/ppc/build/Makefile
===================================================================
--- cpu/ppc/build/Makefile (rev 0)
+++ cpu/ppc/build/Makefile 2008-01-02 23:28:13 UTC (rev 761)
@@ -0,0 +1,27 @@
+OS := $(shell uname)
+
+all: basefw.dic
+
+.PHONY: FORCE all clean
+
+.PRECIOUS: builder.dic
+
+../${OS}/forth:
+ @make -C ../${OS} forth
+
+build: ../${OS}/forth
+ @ln -sf ../${OS}/forth $@
+
+%.dic: FORCE build
+ ./build $@
+
+builder.dic: FORCE build
+ -[ ! -f builder.sav ] && cp builder.dic builder.sav
+ ./build builder.dic
+
+inflate.bin:
+ make -C ../${OS} ../build/inflate.bin
+
+# Don't use *.dic so as not to remove builder.dic
+clean:
+ rm -f tools.dic kernel.dic basefw.dic *.log headers *~ inflate.bin build
Modified: cpu/ppc/build/Makefile.cross
===================================================================
--- cpu/ppc/build/Makefile.cross 2008-01-02 21:41:48 UTC (rev 760)
+++ cpu/ppc/build/Makefile.cross 2008-01-02 23:28:13 UTC (rev 761)
@@ -1,8 +1,36 @@
# This setting of HOSTDIR is for cross-building on an x86 Linux system
# For it to work, you first need to build the simulator version of ppcforth
-# in cpu/ppc/Linux and then copy the ppcforth file to cpu/x86/Linux
-HOSTDIR:=$(shell pwd)/../../../cpu/x86/Linux/
+# in cpu/x86/Linux with "make -f Makefile.ppcforth"
+OS := $(shell uname)
-builder.dic:
- HOSTDIR=${HOSTDIR} build $@
+HOSTCPU:=x86
+HOSTDIR:=../../${HOSTCPU}/${OS}
+all: basefw.dic
+
+.PHONY: FORCE all clean
+
+.PRECIOUS: builder.dic
+
+${HOSTDIR}/forth:
+ @make -C ${HOSTDIR} forth
+
+${HOSTDIR}/ppcforth:
+ @make -C ${HOSTDIR} -f Makefile.ppcforth ppcforth
+
+build: ${HOSTDIR}/forth
+ @ln -sf $< $@
+
+%.dic: FORCE build ${HOSTDIR}/ppcforth
+ ./build $@
+
+builder.dic: FORCE build
+ -[ ! -f builder.sav ] && cp builder.dic builder.sav
+ ./build builder.dic
+
+inflate.bin:
+ make -C ../${OS} ../build/inflate.bin
+
+# Don't use *.dic so as not to remove builder.dic
+clean:
+ rm -f tools.dic kernel.dic basefw.dic *.log headers *~ inflate.bin build
Modified: cpu/x86/Linux/Makefile
===================================================================
--- cpu/x86/Linux/Makefile 2008-01-02 21:41:48 UTC (rev 760)
+++ cpu/x86/Linux/Makefile 2008-01-02 23:28:13 UTC (rev 761)
@@ -1,11 +1,9 @@
# Wrapper makefile for x86 Unix: FreeBSD, Linux, etc.
# Copyright 1997 FirmWorks. All rights reserved.
#
-OS := $(shell uname)
-
BP=../../..
-CFLAGS = -O -g -m32 -DUNIX -D${OS} -DX86
+CFLAGS = -O -g -m32 -DTARGET_X86
# CFLAGS += -DUSE_XCB
WRTAIL = forth/wrapper
Added: cpu/x86/Linux/Makefile.ppcforth
===================================================================
--- cpu/x86/Linux/Makefile.ppcforth (rev 0)
+++ cpu/x86/Linux/Makefile.ppcforth 2008-01-02 23:28:13 UTC (rev 761)
@@ -0,0 +1,56 @@
+# Flags for the simulator version
+OPT = -O
+# OPT =
+
+BP=../../..
+
+CFLAGS = -DPPCSIM -DTARGET_POWERPC
+
+CC = gcc
+
+WRDIR = ${BP}/forth/wrapper
+ZIPDIR = ${WRDIR}/zip
+SIMDIR = ${BP}/cpu/ppc/ppcsim
+
+ZIPOBJS = zipmem.o deflate.o trees.o bits.o util.o inflate.o
+
+OBJS = wrapsim.o ppcsim.o logger.o ${ZIPOBJS}
+TRACEOBJS = wrapsim.o ppcsim.trace.o logger.o ${ZIPOBJS}
+SIMROMOBJS = simrom.o ppcsim.simrom.o
+
+all: ppcforth ppcforth.trace
+
+ppcforth: $(OBJS)
+ $(CC) $(LFLAGS) $(OBJS) -o $@
+
+ppcforth.trace: $(TRACEOBJS)
+ $(CC) $(LFLAGS) $(TRACEOBJS) -o $@
+
+simrom: $(SIMROMOBJS)
+ $(CC) $(LFLAGS) $(SIMROMOBJS) -o $@
+
+wrapsim.o: ${WRDIR}/wrapper.c
+ ${CC} -c ${CFLAGS} $< -o $@
+
+%.o: ${WRDIR}/%.c
+ ${CC} -c ${CFLAGS} $< -o $@
+
+%.o: ${ZIPDIR}/%.c
+ ${CC} -c ${CFLAGS} -I${ZIPDIR} $< -o $@
+
+ppcsim.o: $(SIMDIR)/ppcsim.c
+ $(CC) $(OPT) $(CFLAGS) -DARGREGS -DSIMNEXT -c $< -o $@
+
+ppcsim.trace.o: $(SIMDIR)/ppcsim.c
+ $(CC) $(OPT) $(CFLAGS) -DARGREGS -DSIMNEXT -DTRACE -c $< -o $@
+
+ppcsim.simrom.o: $(SIMDIR)/ppcsim.c
+ $(CC) $(CFLAGS) -DARGREGS -DSIMNEXT -DTRACE -DSIMROM -c $< -o $@
+
+simrom.o: $(SIMDIR)/simrom.c
+ $(CC) $(CFLAGS) -DARGREGS -DSIMNEXT -DTRACE -DSIMROM -c $< -o $@
+
+clean:
+ @rm -f *.o ppcforth ppcforth.trace
+
+FRC:
More information about the OpenBIOS
mailing list