aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2020-08-28 13:04:03 +0200
committerLubomir Rintel <lkundrak@v3.sk>2020-08-30 08:44:35 +0200
commite7e6954158f42ac5aad307d778e02ab62773ea6a (patch)
tree9bf6b295055bf2e94fc64d34d6e97994cce34f02
parent3a1f0b3f9a939286a0b04413d96ada0598b7650a (diff)
downloadopenfirmware-lr/mips-old.tar.gz
mips: fix the buildlr/mips-old
l---------cpu/mips/Linux/build1
-rw-r--r--cpu/mips/Linux/makefile26
-rw-r--r--cpu/mips/build/.gitignore3
-rw-r--r--cpu/mips/build/Makefile38
-rwxr-xr-xcpu/mips/build/build2
5 files changed, 55 insertions, 15 deletions
diff --git a/cpu/mips/Linux/build b/cpu/mips/Linux/build
deleted file mode 120000
index 60451dd1..00000000
--- a/cpu/mips/Linux/build
+++ /dev/null
@@ -1 +0,0 @@
-/home/wmb/ofwmips/cpu/mips/Linux/mipsforth \ No newline at end of file
diff --git a/cpu/mips/Linux/makefile b/cpu/mips/Linux/makefile
index 8145be27..aee2466c 100644
--- a/cpu/mips/Linux/makefile
+++ b/cpu/mips/Linux/makefile
@@ -1,10 +1,12 @@
# Wrapper makefile for Unix: FreeBSD, Linux, etc.
# Copyright 1997 FirmWorks. All rights reserved.
-#
-CC = mipsel-linux-gnu-gcc-4.3
-CFLAGS = -O -g -D__linux__ -DMIPS -DHOSTMIPS
-LFLAGS = -Xlinker -static -static-libgcc
+BP=../../..
+
+CROSS = mips64-linux-gnu-
+CC = $(CROSS)gcc
+CFLAGS = -O -g -D__linux__ -DMIPS -DHOSTMIPS
+LFLAGS =
WRDIR = ${BP}/forth/wrapper
ZIPDIR = ${WRDIR}/zip
@@ -16,23 +18,23 @@ OBJS = wrapper.o logger.o ${ZIPOBJS}
all: forth
wrapper.o: ${BP}/forth/wrapper/wrapper.c
- ${CC} ${CFLAGS} -c ${BP}/forth/wrapper/wrapper.c
+ ${CC} ${CFLAGS} -c ${BP}/forth/wrapper/wrapper.c
%.o: ${WRDIR}/%.c
- ${CC} -c ${CFLAGS} $< -o $@
+ ${CC} -c ${CFLAGS} $< -o $@
%.o: ${ZIPDIR}/%.c
- ${CC} -c ${CFLAGS} -I${ZIPDIR} $< -o $@
+ ${CC} -c ${CFLAGS} -I${ZIPDIR} $< -o $@
forth: ${OBJS}
- ${CC} $(LFLAGS) -o $@ ${OBJS}
+ ${CC} $(LFLAGS) -o $@ ${OBJS}
clean:
- @rm -f forth *.o
+ @rm -f forth *.o
install: forth
- cp forth ${BP}/bin/mips/`uname|tr A-Z a-z`/forth
- cp forth ${BP}/bin/mips/`uname|tr A-Z a-z`/mipsfth
+ cp forth ${BP}/bin/mips/`uname|tr A-Z a-z`/forth
+ cp forth ${BP}/bin/mips/`uname|tr A-Z a-z`/mipsfth
dist:
- (cd ${BP}; zip /tmp/wrapper.zip os/unix/mips/makefile ${SRCS})
+ (cd ${BP}; zip /tmp/wrapper.zip os/unix/mips/makefile ${SRCS})
diff --git a/cpu/mips/build/.gitignore b/cpu/mips/build/.gitignore
new file mode 100644
index 00000000..2ab9de4c
--- /dev/null
+++ b/cpu/mips/build/.gitignore
@@ -0,0 +1,3 @@
+mipsfth
+forth
+build
diff --git a/cpu/mips/build/Makefile b/cpu/mips/build/Makefile
new file mode 100644
index 00000000..a76c4214
--- /dev/null
+++ b/cpu/mips/build/Makefile
@@ -0,0 +1,38 @@
+BASEDIR= $(shell cd ../../../; pwd)
+
+OS := $(shell uname)
+HOSTCPU= $(shell ${BASEDIR}/forth/lib/hostcpu.sh)
+HOSTDIR= ${BASEDIR}/cpu/${HOSTCPU}/${OS}
+BUILDSH= ${BASEDIR}/forth/lib/build.sh
+
+all: basefw.dic
+
+.PHONY: FORCE all clean
+
+.PRECIOUS: builder.dic
+
+${HOSTDIR}/forth: FORCE
+ @make -C ${HOSTDIR} forth
+
+${HOSTDIR}/mipsfth: FORCE
+ @make -C ${HOSTDIR} mipsfth
+
+build: ${HOSTDIR}/forth ${HOSTDIR}/mipsfth
+ @ln -sf ${BUILDSH} build
+
+%.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
+ rm -f *.tag *.log headers *~ inflate.bin build
+ @make -C ../${OS} clean
+ @make -C ${HOSTDIR} clean
diff --git a/cpu/mips/build/build b/cpu/mips/build/build
deleted file mode 100755
index 8fd14339..00000000
--- a/cpu/mips/build/build
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-qemu-mipsel ../Linux/build $@