[openfirmware] [commit] r2127 - in cpu: arm/openmoko/build x86/Darwin x86/Linux

repository service svn at openfirmware.info
Thu Jan 20 00:32:43 CET 2011


Author: wmb
Date: Thu Jan 20 00:32:43 2011
New Revision: 2127
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2127

Log:
Makefile frobbing to make the Darwin Makefile correspond to the Linux Makefile.

Modified:
   cpu/arm/openmoko/build/Makefile
   cpu/x86/Darwin/Makefile
   cpu/x86/Linux/Makefile

Modified: cpu/arm/openmoko/build/Makefile
==============================================================================
--- cpu/arm/openmoko/build/Makefile	Thu Jan 20 00:28:37 2011	(r2126)
+++ cpu/arm/openmoko/build/Makefile	Thu Jan 20 00:32:43 2011	(r2127)
@@ -18,12 +18,15 @@
 tags: ${ROMNAME}.tag
 	@${BASEDIR}/forth/lib/toctags ${BASEDIR} ${TAGFILES}
 
-${ROMNAME}.rom: FORCE build ${CLIENTPROGS} ${HOSTDIR}/forth
+${ROMNAME}.rom: FORCE build ${CLIENTPROGS} ${HOSTDIR}/forth ${HOSTDIR}/armforth
 	./build $@
 
 ${HOSTDIR}/forth:
 	@make -C ${HOSTDIR} forth
 
+${HOSTDIR}/armforth:
+	@make -C ${HOSTDIR} armforth
+
 ../../build/inflate.bin:
 	@make -C ../../build inflate.bin
 

Modified: cpu/x86/Darwin/Makefile
==============================================================================
--- cpu/x86/Darwin/Makefile	Thu Jan 20 00:28:37 2011	(r2126)
+++ cpu/x86/Darwin/Makefile	Thu Jan 20 00:32:43 2011	(r2127)
@@ -2,67 +2,87 @@
 
 BP=../../..
 
-CFLAGS	= -g -m32 -DTARGET_X86
+# Flags for the OS and CPU
+MFLAGS = -m32
+
+OPT = -O
+CFLAGS	= -g $(MFLAGS) -DTARGET_X86
+LFLAGS  = $(MFLAGS)
 
 # Extra CFLAGS needed by Darwin hosts. GCC doesn't define __unix__ here,
 # so we must include it ourselves.
 CFLAGS += -D__unix__=1 -Wimplicit-function-declaration
-#CFLAGS += -DUSE_XCB
+SIMCFLAGS += -D__unix__=1 -Wimplicit-function-declaration
 
 WRTAIL = forth/wrapper
 WRDIR = ${BP}/${WRTAIL}
+
+ifdef OMIT_ZIP
+ZIPDIR = ${WRDIR}
+ZIPOBJS = nullzip.o
+INFLATEBIN =
+else
 ZIPTAIL = ${WRTAIL}/zip
 ZIPDIR = ${BP}/${ZIPTAIL}
 
-# Apple's GCC is a bit brain-dead. It's probably best to install gcc43 and
-# binutils from macports. See http://macports.macforge.net for how to install
-# and use macports. At the very least, binutils from macports seems to be
-# required.
-
-# The default compiler on Mac OS X (as of 10.5 anyway) does not honor -fpic.
-# GCC will warn about -fpic not being supported, assumes you meant -fPIC,
-# and switches to that. That should be okay, but if you're concerned about it
-# I'm providing this already defined override for ${CC}. To use it, just 
-# uncomment it, or pass CC= on the command line. This is here to make things
-# easier for us lazy people.
-#CC = /opt/local/bin/gcc-mp-4.3
-
-# Unfortunately, Mac OS X does not ship with objcopy. This means that one must
-# install binutils from macports, so we override the OBJCOPY variable here
-# and just use that instead of calling 'objcopy' itself.
-OBJCOPY = /opt/local/bin/gobjcopy
-
 ZIPOBJS = zipmem.o deflate.o trees.o bits.o util.o inflate.o
-
-OBJS = wrapper.o logger.o ${ZIPOBJS}
-
-all: forth x86forth ../build/inflate.bin
-
-# Use forth when you just need to run Forth but don't care what
-# native instruction set it is on.
-# Use x86forth when you need to compile new dictionaries that will
-# run on x86 systems.
-forth: ${OBJS}
-	${CC} -m32 -o $@ ${OBJS}
-	@ln -sf forth x86forth
+INFLATEBIN = ../../build/inflate.bin
 
 # Compile with -O0 because with GCC4, higher optimization levels cause the
 # functions to be reordered so the "inflate" entry point is no longer at
 # the beginning.
 inflate.o: ${ZIPDIR}/inflate.c
-	${CC} -c -m32 -O0 -fpic $< -o $@
+	${CC} -c ${MFLAGS} -O0 -fpic $< -o $@
 
 # Well, we're not going to get objcopy in a generic OS X environment, so
 # let's just fake it.
 ../build/inflate.bin: inflate.o
-	# ${OBJCOPY} -O binary $< $@
 	dd if=$< of=$@ bs=256 skip=1
+endif
+
+OBJS = wrapper.o logger.o ${ZIPOBJS}
+
+all: forth x86forth ${INFLATEBIN}
+
+# Use forth when you just need to run Forth but don't care what
+# native instruction set it is on.
+# Use x86forth when you need to compile new dictionaries that will
+# run on x86 systems.
+forth: ${OBJS}
+	${CC} $(MFLAGS) -o $@ ${OBJS}
+	@ln -sf forth x86forth
 
 %.o: ${WRDIR}/%.c
-	${CC} -c ${CFLAGS} -I${ZIPDIR} $< -o $@
+	${CC} -c ${OPT} ${CFLAGS} $< -o $@
 
 %.o: ${ZIPDIR}/%.c
-	${CC} -c ${CFLAGS} -I${ZIPDIR} $< -o $@
+	${CC} -c ${OPT} ${CFLAGS} -I${ZIPDIR} $< -o $@
+
+# ARM simulator wrapper build rules
+
+ARMDIR = ${BP}/cpu/arm
+ARMCFLAGS = -g ${MFLAGS} -DARMSIM -DTARGET_ARM -DARM -DSIMNEXT
+ARMSIMOBJS = wrapsim.o armsim.o logger.o ${ZIPOBJS}
+ARMTRACEOBJS = wrapsim.o armsim.trace.o logger.o ${ZIPOBJS}
+
+# Extra CFLAGS needed by Darwin hosts. GCC doesn't define __unix__ here,
+# so we must include it ourselves.
+ARMCFLAGS += -D__unix__=1 -Wimplicit-function-declaration
+
+%.o: ${ARMDIR}/%.c
+	${CC} -c ${ARMCFLAGS} $< -o $@
+
+wrapsim.o: ${WRDIR}/wrapper.c
+	${CC} -c ${ARMCFLAGS} -c $< -o $@
+
+armsim.trace.o: $(ARMDIR)/armsim.c
+	${CC} -c ${ARMCFLAGS} -DTRACE=1 -c $< -o $@
+
+armforth: ${ARMSIMOBJS}
+	${CC} ${ARMSIMOBJS} -o $@
+
+armforth.trace: ${ARMTRACEOBJS}
+	${CC} ${ARMTRACEOBJS}  -o $@
 
 clean:
-	@rm -f forth x86forth *.o *~ inflate.bin
+	@rm -f forth x86forth armforth *.o *~ inflate.bin

Modified: cpu/x86/Linux/Makefile
==============================================================================
--- cpu/x86/Linux/Makefile	Thu Jan 20 00:28:37 2011	(r2126)
+++ cpu/x86/Linux/Makefile	Thu Jan 20 00:32:43 2011	(r2127)
@@ -2,7 +2,12 @@
 
 BP=../../..
 
-CFLAGS	= -O -g -m32 -DTARGET_X86
+# Flags for the OS and CPU
+MFLAGS = -m32
+
+OPT = -O
+CFLAGS	= -g $(MFLAGS) -DTARGET_X86
+LFLAGS = $(MFLAGS)
 
 # Uncomment these lines to include X windows support to the wrapper
 # via libxcb.  The libxcb development package (headers, etc) must be
@@ -13,11 +18,19 @@
 
 WRTAIL = forth/wrapper
 WRDIR = ${BP}/${WRTAIL}
+
+ifdef OMIT_ZIP
+ZIPDIR = ${WRDIR}
+ZIPOBJS = nullzip.o
+INFLATEBIN =
+else
 ZIPTAIL = ${WRTAIL}/zip
 ZIPDIR = ${BP}/${ZIPTAIL}
 
 ZIPOBJS = zipmem.o deflate.o trees.o bits.o util.o inflate.o
 
+endif
+
 OBJS += wrapper.o logger.o ${ZIPOBJS}
 
 all: forth x86forth ../build/inflate.bin
@@ -27,11 +40,11 @@
 # Use x86forth when you need to compile new dictionaries that will
 # run on x86 systems.
 forth: ${OBJS}
-	${CC} -m32 -o $@ ${OBJS} ${LIBS}
+	${CC} ${MFLAGS} -o $@ ${OBJS} ${LIBS}
 	@ln -sf forth x86forth
 
 inflate.lo: ${ZIPDIR}/inflate.c
-	${CC} -c -m32 -Wall -fno-stack-protector -ffreestanding -D_FORTIFY_SOURCE=0 -DNEED_BCOPY -O3 -fpic $< -o $@
+	${CC} -c $(MFLAGS) -Wall -fno-stack-protector -ffreestanding -D_FORTIFY_SOURCE=0 -DNEED_BCOPY -O3 -fpic $< -o $@
 
 inflate.o: inflate.lo
 	${LD} -melf_i386 -T inflate.ld $< -o $@
@@ -40,15 +53,15 @@
 	objcopy -O binary $< $@
 
 %.o: ${WRDIR}/%.c
-	${CC} -c ${CFLAGS} $< -o $@
+	${CC} -c ${OPT} ${CFLAGS} $< -o $@
 
 %.o: ${ZIPDIR}/%.c
-	${CC} -c ${CFLAGS} -I${ZIPDIR} $< -o $@
+	${CC} -c ${OPT} ${CFLAGS} -I${ZIPDIR} $< -o $@
 
 # ARM simulator wrapper build rules
 
 ARMDIR = ${BP}/cpu/arm
-ARMCFLAGS = -g -m32 -DARMSIM -DTARGET_ARM -DARM -DSIMNEXT
+ARMCFLAGS = -g ${MFLAGS} -DARMSIM -DTARGET_ARM -DARM -DSIMNEXT
 ARMSIMOBJS = wrapsim.o armsim.o logger.o ${ZIPOBJS}
 ARMTRACEOBJS = wrapsim.o armsim.trace.o logger.o ${ZIPOBJS}
 



More information about the openfirmware mailing list