Fixed issues with multiple kernel builds.

This commit is contained in:
Serge Vakulenko
2015-09-04 18:55:56 -07:00
parent 8ba13c2f71
commit 9f05f511a6
21 changed files with 111 additions and 100 deletions

View File

@@ -9,7 +9,7 @@ AS = ${MIPS_GCC_PREFIX}as ${DEBUG} -mips32r2 -EL
CC = ${MIPS_GCC_PREFIX}gcc ${DEBUG} -mips32r2 -EL -nostdinc -fno-builtin -Werror -Wall
CPP = ${MIPS_GCC_PREFIX}cpp
LD = ${MIPS_GCC_PREFIX}gcc -mips32r2 -EL
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=unix.map
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=$(basename $@).map
SIZE = ${MIPS_GCC_PREFIX}size
OBJCOPY = ${MIPS_GCC_PREFIX}objcopy
OBJDUMP = ${MIPS_GCC_PREFIX}objdump
@@ -44,14 +44,14 @@ SYSTEM_OBJ = startup.o ${OBJS} #ioconf.o
ifeq (devcfg.c,$(wildcard devcfg.c))
SYSTEM_OBJ += devcfg.o
endif
SYSTEM_DEP = Makefile ioconf.c swapunix.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_DEP = Makefile ioconf.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_LD_HEAD = sh ../newvers.sh > vers.c; ${CC} $(CFLAGS) -c vers.c; rm -f $@
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o unix.elf; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o unix.elf
SYSTEM_LD_TAIL = ${SIZE} unix.elf; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ unix.hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ unix.bin; \
$(OBJDUMP) -d -S unix.elf > unix.dis
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o $@; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o $@
SYSTEM_LD_TAIL = ${SIZE} $@; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ $(basename $@).hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ $(basename $@).bin; \
$(OBJDUMP) -d -S $@ > $(basename $@).dis
%LOAD
@@ -59,11 +59,12 @@ clean:
rm -rf .deps *.elf *.o *.map *.dis *.bin machine sys
clean-all: clean
rm -f *.h ioconf.c swapunix.c vers.c
rm -f *.h *.hex ioconf.c swap*.c vers.c
reconfig ioconf.c swapunix.c: Config ../../../tools/kconfig/kconfig
reconfig ioconf.c: Config ../../../tools/kconfig/kconfig
../../../tools/kconfig/kconfig Config
$(MAKE) clean
rm -f *.hex
load: unix.elf
pic32prog unix.hex

View File

@@ -34,7 +34,6 @@ options "LED_DISK_PIN=1" # ...use pin RC1
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
config unix root on sd0a
swap on sd0b
dumps on sd0b
# Console options
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB

View File

@@ -34,7 +34,6 @@ options "LED_DISK_PIN=1" # ...use pin RC1
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
config unix root on sd0a
swap on sd0b
dumps on sd0b
# Console options
options "CONSOLE_DEVICE=tty4" # Console on UART5

View File

@@ -33,7 +33,7 @@ AS = ${MIPS_GCC_PREFIX}as ${DEBUG} -mips32r2 -EL
CC = ${MIPS_GCC_PREFIX}gcc ${DEBUG} -mips32r2 -EL -nostdinc -fno-builtin -Werror -Wall
CPP = ${MIPS_GCC_PREFIX}cpp
LD = ${MIPS_GCC_PREFIX}gcc -mips32r2 -EL
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=unix.map
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=$(basename $@).map
SIZE = ${MIPS_GCC_PREFIX}size
OBJCOPY = ${MIPS_GCC_PREFIX}objcopy
OBJDUMP = ${MIPS_GCC_PREFIX}objdump
@@ -106,14 +106,16 @@ SYSTEM_OBJ = startup.o ${OBJS} #ioconf.o
ifeq (devcfg.c,$(wildcard devcfg.c))
SYSTEM_OBJ += devcfg.o
endif
SYSTEM_DEP = Makefile ioconf.c swapunix.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_DEP = Makefile ioconf.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_LD_HEAD = sh ../newvers.sh > vers.c; ${CC} $(CFLAGS) -c vers.c; rm -f $@
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o unix.elf; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o unix.elf
SYSTEM_LD_TAIL = ${SIZE} unix.elf; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ unix.hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ unix.bin; \
$(OBJDUMP) -d -S unix.elf > unix.dis
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o $@; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o $@
SYSTEM_LD_TAIL = ${SIZE} $@; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ $(basename $@).hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ $(basename $@).bin; \
$(OBJDUMP) -d -S $@ > $(basename $@).dis
unix: unix.elf
unix.elf: ${SYSTEM_DEP} swapunix.o
${SYSTEM_LD_HEAD}
@@ -123,17 +125,18 @@ unix.elf: ${SYSTEM_DEP} swapunix.o
swapunix.o: swapunix.c
${COMPILE_C}
all: unix.elf
all: unix
clean:
rm -rf .deps *.elf *.o *.map *.dis *.bin machine sys
clean-all: clean
rm -f *.h ioconf.c swapunix.c vers.c
rm -f *.h *.hex ioconf.c swap*.c vers.c
reconfig ioconf.c swapunix.c: Config ../../../tools/kconfig/kconfig
reconfig ioconf.c: Config ../../../tools/kconfig/kconfig
../../../tools/kconfig/kconfig Config
$(MAKE) clean
rm -f *.hex
load: unix.elf
pic32prog unix.hex

View File

@@ -33,7 +33,6 @@ options "LED_DISK_PIN=12" # ...use pin RB12
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
config unix root on sd0a
swap on sd0b
dumps on sd0b
# Console options
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB

View File

@@ -33,7 +33,6 @@ options "LED_DISK_PIN=12" # ...use pin RB12
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
config unix root on sd0a
swap on sd0b
dumps on sd0b
# Console options
options "CONSOLE_DEVICE=tty4" # Console on UART5

View File

@@ -33,7 +33,7 @@ AS = ${MIPS_GCC_PREFIX}as ${DEBUG} -mips32r2 -EL
CC = ${MIPS_GCC_PREFIX}gcc ${DEBUG} -mips32r2 -EL -nostdinc -fno-builtin -Werror -Wall
CPP = ${MIPS_GCC_PREFIX}cpp
LD = ${MIPS_GCC_PREFIX}gcc -mips32r2 -EL
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=unix.map
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=$(basename $@).map
SIZE = ${MIPS_GCC_PREFIX}size
OBJCOPY = ${MIPS_GCC_PREFIX}objcopy
OBJDUMP = ${MIPS_GCC_PREFIX}objdump
@@ -106,14 +106,16 @@ SYSTEM_OBJ = startup.o ${OBJS} #ioconf.o
ifeq (devcfg.c,$(wildcard devcfg.c))
SYSTEM_OBJ += devcfg.o
endif
SYSTEM_DEP = Makefile ioconf.c swapunix.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_DEP = Makefile ioconf.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_LD_HEAD = sh ../newvers.sh > vers.c; ${CC} $(CFLAGS) -c vers.c; rm -f $@
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o unix.elf; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o unix.elf
SYSTEM_LD_TAIL = ${SIZE} unix.elf; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ unix.hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ unix.bin; \
$(OBJDUMP) -d -S unix.elf > unix.dis
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o $@; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o $@
SYSTEM_LD_TAIL = ${SIZE} $@; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ $(basename $@).hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ $(basename $@).bin; \
$(OBJDUMP) -d -S $@ > $(basename $@).dis
unix: unix.elf
unix.elf: ${SYSTEM_DEP} swapunix.o
${SYSTEM_LD_HEAD}
@@ -123,17 +125,18 @@ unix.elf: ${SYSTEM_DEP} swapunix.o
swapunix.o: swapunix.c
${COMPILE_C}
all: unix.elf
all: unix
clean:
rm -rf .deps *.elf *.o *.map *.dis *.bin machine sys
clean-all: clean
rm -f *.h ioconf.c swapunix.c vers.c
rm -f *.h *.hex ioconf.c swap*.c vers.c
reconfig ioconf.c swapunix.c: Config ../../../tools/kconfig/kconfig
reconfig ioconf.c: Config ../../../tools/kconfig/kconfig
../../../tools/kconfig/kconfig Config
$(MAKE) clean
rm -f *.hex
load: unix.elf
pic32prog unix.hex

View File

@@ -31,7 +31,6 @@ options "LED_KERNEL_PIN=5" # ...use pin RE5
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
config unix root on sd0a
swap on sd0b
dumps on sd0b
# Console options
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB

View File

@@ -35,7 +35,6 @@ options "LED_KERNEL_PIN=5" # ...use pin RE5
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
config unix root on sd0a
swap on sd0b
dumps on sd0b
# Console options
options "CONSOLE_DEVICE=tty1" # Console on UART2

View File

@@ -30,7 +30,7 @@ AS = ${MIPS_GCC_PREFIX}as ${DEBUG} -mips32r2 -EL
CC = ${MIPS_GCC_PREFIX}gcc ${DEBUG} -mips32r2 -EL -nostdinc -fno-builtin -Werror -Wall
CPP = ${MIPS_GCC_PREFIX}cpp
LD = ${MIPS_GCC_PREFIX}gcc -mips32r2 -EL
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=unix.map
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=$(basename $@).map
SIZE = ${MIPS_GCC_PREFIX}size
OBJCOPY = ${MIPS_GCC_PREFIX}objcopy
OBJDUMP = ${MIPS_GCC_PREFIX}objdump
@@ -103,14 +103,16 @@ SYSTEM_OBJ = startup.o ${OBJS} #ioconf.o
ifeq (devcfg.c,$(wildcard devcfg.c))
SYSTEM_OBJ += devcfg.o
endif
SYSTEM_DEP = Makefile ioconf.c swapunix.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_DEP = Makefile ioconf.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_LD_HEAD = sh ../newvers.sh > vers.c; ${CC} $(CFLAGS) -c vers.c; rm -f $@
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o unix.elf; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o unix.elf
SYSTEM_LD_TAIL = ${SIZE} unix.elf; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ unix.hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ unix.bin; \
$(OBJDUMP) -d -S unix.elf > unix.dis
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o $@; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o $@
SYSTEM_LD_TAIL = ${SIZE} $@; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ $(basename $@).hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ $(basename $@).bin; \
$(OBJDUMP) -d -S $@ > $(basename $@).dis
unix: unix.elf
unix.elf: ${SYSTEM_DEP} swapunix.o
${SYSTEM_LD_HEAD}
@@ -120,17 +122,18 @@ unix.elf: ${SYSTEM_DEP} swapunix.o
swapunix.o: swapunix.c
${COMPILE_C}
all: unix.elf
all: unix
clean:
rm -rf .deps *.elf *.o *.map *.dis *.bin machine sys
clean-all: clean
rm -f *.h ioconf.c swapunix.c vers.c
rm -f *.h *.hex ioconf.c swap*.c vers.c
reconfig ioconf.c swapunix.c: Config ../../../tools/kconfig/kconfig
reconfig ioconf.c: Config ../../../tools/kconfig/kconfig
../../../tools/kconfig/kconfig Config
$(MAKE) clean
rm -f *.hex
load: unix.elf
pic32prog unix.hex

View File

@@ -30,7 +30,6 @@ options "LED_KERNEL_PIN=3" # ...use pin RA3
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
config unix root on sd0a
swap on sd0b
dumps on sd0b
# Serial UART ports
device uart1 # Serial-to-USB converter

View File

@@ -31,7 +31,7 @@ AS = ${MIPS_GCC_PREFIX}as ${DEBUG} -mips32r2 -EL
CC = ${MIPS_GCC_PREFIX}gcc ${DEBUG} -mips32r2 -EL -nostdinc -fno-builtin -Werror -Wall
CPP = ${MIPS_GCC_PREFIX}cpp
LD = ${MIPS_GCC_PREFIX}gcc -mips32r2 -EL
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=unix.map
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=$(basename $@).map
SIZE = ${MIPS_GCC_PREFIX}size
OBJCOPY = ${MIPS_GCC_PREFIX}objcopy
OBJDUMP = ${MIPS_GCC_PREFIX}objdump
@@ -102,14 +102,16 @@ SYSTEM_OBJ = startup.o ${OBJS} #ioconf.o
ifeq (devcfg.c,$(wildcard devcfg.c))
SYSTEM_OBJ += devcfg.o
endif
SYSTEM_DEP = Makefile ioconf.c swapunix.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_DEP = Makefile ioconf.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_LD_HEAD = sh ../newvers.sh > vers.c; ${CC} $(CFLAGS) -c vers.c; rm -f $@
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o unix.elf; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o unix.elf
SYSTEM_LD_TAIL = ${SIZE} unix.elf; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ unix.hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ unix.bin; \
$(OBJDUMP) -d -S unix.elf > unix.dis
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o $@; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o $@
SYSTEM_LD_TAIL = ${SIZE} $@; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ $(basename $@).hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ $(basename $@).bin; \
$(OBJDUMP) -d -S $@ > $(basename $@).dis
unix: unix.elf
unix.elf: ${SYSTEM_DEP} swapunix.o
${SYSTEM_LD_HEAD}
@@ -119,17 +121,18 @@ unix.elf: ${SYSTEM_DEP} swapunix.o
swapunix.o: swapunix.c
${COMPILE_C}
all: unix.elf
all: unix
clean:
rm -rf .deps *.elf *.o *.map *.dis *.bin machine sys
clean-all: clean
rm -f *.h ioconf.c swapunix.c vers.c
rm -f *.h *.hex ioconf.c swap*.c vers.c
reconfig ioconf.c swapunix.c: Config ../../../tools/kconfig/kconfig
reconfig ioconf.c: Config ../../../tools/kconfig/kconfig
../../../tools/kconfig/kconfig Config
$(MAKE) clean
rm -f *.hex
load: unix.elf
pic32prog unix.hex

View File

@@ -27,7 +27,6 @@ options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
config unix root on sd0a
swap on sd0b
dumps on sd0b
# Serial UART ports
device uart1 # Serial-to-USB converter

View File

@@ -27,7 +27,6 @@ options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
config unix root on sd0a
swap on sd0b
dumps on sd0b
# Serial UART ports
device uart1 # Serial-to-USB converter

View File

@@ -27,7 +27,7 @@ AS = ${MIPS_GCC_PREFIX}as ${DEBUG} -mips32r2 -EL
CC = ${MIPS_GCC_PREFIX}gcc ${DEBUG} -mips32r2 -EL -nostdinc -fno-builtin -Werror -Wall
CPP = ${MIPS_GCC_PREFIX}cpp
LD = ${MIPS_GCC_PREFIX}gcc -mips32r2 -EL
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=unix.map
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=$(basename $@).map
SIZE = ${MIPS_GCC_PREFIX}size
OBJCOPY = ${MIPS_GCC_PREFIX}objcopy
OBJDUMP = ${MIPS_GCC_PREFIX}objdump
@@ -99,14 +99,16 @@ SYSTEM_OBJ = startup.o ${OBJS} #ioconf.o
ifeq (devcfg.c,$(wildcard devcfg.c))
SYSTEM_OBJ += devcfg.o
endif
SYSTEM_DEP = Makefile ioconf.c swapunix.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_DEP = Makefile ioconf.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_LD_HEAD = sh ../newvers.sh > vers.c; ${CC} $(CFLAGS) -c vers.c; rm -f $@
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o unix.elf; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o unix.elf
SYSTEM_LD_TAIL = ${SIZE} unix.elf; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ unix.hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ unix.bin; \
$(OBJDUMP) -d -S unix.elf > unix.dis
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o $@; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o $@
SYSTEM_LD_TAIL = ${SIZE} $@; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ $(basename $@).hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ $(basename $@).bin; \
$(OBJDUMP) -d -S $@ > $(basename $@).dis
unix: unix.elf
unix.elf: ${SYSTEM_DEP} swapunix.o
${SYSTEM_LD_HEAD}
@@ -116,17 +118,18 @@ unix.elf: ${SYSTEM_DEP} swapunix.o
swapunix.o: swapunix.c
${COMPILE_C}
all: unix.elf
all: unix
clean:
rm -rf .deps *.elf *.o *.map *.dis *.bin machine sys
clean-all: clean
rm -f *.h ioconf.c swapunix.c vers.c
rm -f *.h *.hex ioconf.c swap*.c vers.c
reconfig ioconf.c swapunix.c: Config ../../../tools/kconfig/kconfig
reconfig ioconf.c: Config ../../../tools/kconfig/kconfig
../../../tools/kconfig/kconfig Config
$(MAKE) clean
rm -f *.hex
load: unix.elf
pic32prog unix.hex

View File

@@ -42,7 +42,6 @@ options "LED_TTY_INVERT"
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
config unix root on sd0a
swap on sd0b
dumps on sd0b
# Console options
options "CONSOLE_DEVICE=ttyUSB0" # Console on USB

View File

@@ -41,7 +41,6 @@ options "LED_TTY_INVERT"
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
config unix root on sd0a
swap on sd0b
dumps on sd0b
# Console options
options "CONSOLE_DEVICE=tty1" # Console on UART2

View File

@@ -42,7 +42,7 @@ AS = ${MIPS_GCC_PREFIX}as ${DEBUG} -mips32r2 -EL
CC = ${MIPS_GCC_PREFIX}gcc ${DEBUG} -mips32r2 -EL -nostdinc -fno-builtin -Werror -Wall
CPP = ${MIPS_GCC_PREFIX}cpp
LD = ${MIPS_GCC_PREFIX}gcc -mips32r2 -EL
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=unix.map
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=$(basename $@).map
SIZE = ${MIPS_GCC_PREFIX}size
OBJCOPY = ${MIPS_GCC_PREFIX}objcopy
OBJDUMP = ${MIPS_GCC_PREFIX}objdump
@@ -115,14 +115,16 @@ SYSTEM_OBJ = startup.o ${OBJS} #ioconf.o
ifeq (devcfg.c,$(wildcard devcfg.c))
SYSTEM_OBJ += devcfg.o
endif
SYSTEM_DEP = Makefile ioconf.c swapunix.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_DEP = Makefile ioconf.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_LD_HEAD = sh ../newvers.sh > vers.c; ${CC} $(CFLAGS) -c vers.c; rm -f $@
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o unix.elf; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o unix.elf
SYSTEM_LD_TAIL = ${SIZE} unix.elf; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ unix.hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ unix.bin; \
$(OBJDUMP) -d -S unix.elf > unix.dis
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o $@; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o $@
SYSTEM_LD_TAIL = ${SIZE} $@; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ $(basename $@).hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ $(basename $@).bin; \
$(OBJDUMP) -d -S $@ > $(basename $@).dis
unix: unix.elf
unix.elf: ${SYSTEM_DEP} swapunix.o
${SYSTEM_LD_HEAD}
@@ -132,17 +134,18 @@ unix.elf: ${SYSTEM_DEP} swapunix.o
swapunix.o: swapunix.c
${COMPILE_C}
all: unix.elf
all: unix
clean:
rm -rf .deps *.elf *.o *.map *.dis *.bin machine sys
clean-all: clean
rm -f *.h ioconf.c swapunix.c vers.c
rm -f *.h *.hex ioconf.c swap*.c vers.c
reconfig ioconf.c swapunix.c: Config ../../../tools/kconfig/kconfig
reconfig ioconf.c: Config ../../../tools/kconfig/kconfig
../../../tools/kconfig/kconfig Config
$(MAKE) clean
rm -f *.hex
load: unix.elf
pic32prog unix.hex

View File

@@ -32,7 +32,6 @@ options "LED_TTY_PIN=1" # ...use pin RA1
# Root filesystem at /dev/sd0a, swap at /dev/sd0b
config unix root on sd0a
swap on sd0b
dumps on sd0b
# Serial UART ports
device uart1 # Serial-to-USB converter

View File

@@ -32,7 +32,7 @@ AS = ${MIPS_GCC_PREFIX}as ${DEBUG} -mips32r2 -EL
CC = ${MIPS_GCC_PREFIX}gcc ${DEBUG} -mips32r2 -EL -nostdinc -fno-builtin -Werror -Wall
CPP = ${MIPS_GCC_PREFIX}cpp
LD = ${MIPS_GCC_PREFIX}gcc -mips32r2 -EL
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=unix.map
LDFLAGS = -nostdlib -T ../${LDSCRIPT} -Wl,-Map=$(basename $@).map
SIZE = ${MIPS_GCC_PREFIX}size
OBJCOPY = ${MIPS_GCC_PREFIX}objcopy
OBJDUMP = ${MIPS_GCC_PREFIX}objdump
@@ -103,14 +103,16 @@ SYSTEM_OBJ = startup.o ${OBJS} #ioconf.o
ifeq (devcfg.c,$(wildcard devcfg.c))
SYSTEM_OBJ += devcfg.o
endif
SYSTEM_DEP = Makefile ioconf.c swapunix.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_DEP = Makefile ioconf.c machine sys .deps ${SYSTEM_OBJ}
SYSTEM_LD_HEAD = sh ../newvers.sh > vers.c; ${CC} $(CFLAGS) -c vers.c; rm -f $@
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o unix.elf; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o unix.elf
SYSTEM_LD_TAIL = ${SIZE} unix.elf; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ unix.hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ unix.bin; \
$(OBJDUMP) -d -S unix.elf > unix.dis
SYSTEM_LD = -@echo ${LD} ${LDFLAGS} '$${SYSTEM_OBJ}' vers.o -o $@; \
${LD} ${LDFLAGS} ${SYSTEM_OBJ} vers.o -o $@
SYSTEM_LD_TAIL = ${SIZE} $@; \
$(OBJCOPY) -O ihex --change-addresses=0x80000000 $@ $(basename $@).hex; \
$(OBJCOPY) -O binary -R .boot -R .config $@ $(basename $@).bin; \
$(OBJDUMP) -d -S $@ > $(basename $@).dis
unix: unix.elf
unix.elf: ${SYSTEM_DEP} swapunix.o
${SYSTEM_LD_HEAD}
@@ -120,17 +122,18 @@ unix.elf: ${SYSTEM_DEP} swapunix.o
swapunix.o: swapunix.c
${COMPILE_C}
all: unix.elf
all: unix
clean:
rm -rf .deps *.elf *.o *.map *.dis *.bin machine sys
clean-all: clean
rm -f *.h ioconf.c swapunix.c vers.c
rm -f *.h *.hex ioconf.c swap*.c vers.c
reconfig ioconf.c swapunix.c: Config ../../../tools/kconfig/kconfig
reconfig ioconf.c: Config ../../../tools/kconfig/kconfig
../../../tools/kconfig/kconfig Config
$(MAKE) clean
rm -f *.hex
load: unix.elf
pic32prog unix.hex