Modify Makefile.kconf to generate dependency files automatically.
This commit is contained in:
@@ -21,7 +21,8 @@ endif
|
||||
# sources are located via $S relative to the compilation directory
|
||||
S = ../..
|
||||
|
||||
DEFS = -I. ${PARAM} -DKERNEL
|
||||
DEPFLAGS = -MT $@ -MP -MD -MF .deps/$*.dep
|
||||
DEFS = -I. ${PARAM} -DKERNEL $(DEPFLAGS)
|
||||
CFLAGS = -O ${DEFS}
|
||||
|
||||
# compile rules: rules are named COMPILE_${SUFFIX}
|
||||
@@ -43,7 +44,7 @@ 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 ${SYSTEM_OBJ}
|
||||
SYSTEM_DEP = Makefile ioconf.c swapunix.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
|
||||
@@ -55,7 +56,7 @@ SYSTEM_LD_TAIL = ${SIZE} unix.elf; \
|
||||
%LOAD
|
||||
|
||||
clean:
|
||||
rm -f *.elf *.o *.map *.dis *.bin
|
||||
rm -rf .deps *.elf *.o *.map *.dis *.bin
|
||||
|
||||
clean-all: clean
|
||||
rm -f *.h *.c machine sys
|
||||
@@ -73,6 +74,9 @@ machine:
|
||||
sys:
|
||||
ln -s ../../include $@
|
||||
|
||||
.deps:
|
||||
mkdir .deps
|
||||
|
||||
startup.o: ../startup.S
|
||||
${COMPILE_S}
|
||||
|
||||
@@ -80,3 +84,7 @@ ioconf.o: ioconf.c
|
||||
${COMPILE_C}
|
||||
|
||||
%RULES
|
||||
|
||||
ifeq (.deps, $(wildcard .deps))
|
||||
-include .deps/*.dep
|
||||
endif
|
||||
|
||||
@@ -11,15 +11,12 @@
|
||||
# For details, see http://retrobsd.org/wiki/doku.php/doc/kconfig
|
||||
#
|
||||
architecture "pic32"
|
||||
|
||||
cpu "PIC32MX7"
|
||||
board "CHIPKIT_MAX32"
|
||||
|
||||
# Linker script
|
||||
ldscript "cfg/bootloader-max32.ld"
|
||||
cpu "PIC32MX7" # Processor variant
|
||||
board "CHIPKIT_MAX32" # Board type
|
||||
hz 100 # Rate of clock interrupt
|
||||
ldscript "cfg/bootloader-max32.ld" # Linker script
|
||||
|
||||
# Standard system options
|
||||
hz 100 # Rate of clock interrupt
|
||||
options "CPU_KHZ=80000" # Oscillator frequency of CPU core
|
||||
options "BUS_KHZ=80000" # Frequency of peripheral bus
|
||||
options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
|
||||
|
||||
@@ -43,7 +43,8 @@ endif
|
||||
# sources are located via $S relative to the compilation directory
|
||||
S = ../..
|
||||
|
||||
DEFS = -I. ${PARAM} -DKERNEL
|
||||
DEPFLAGS = -MT $@ -MP -MD -MF .deps/$*.dep
|
||||
DEFS = -I. ${PARAM} -DKERNEL $(DEPFLAGS)
|
||||
CFLAGS = -O ${DEFS}
|
||||
|
||||
# compile rules: rules are named COMPILE_${SUFFIX}
|
||||
@@ -101,7 +102,7 @@ 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 ${SYSTEM_OBJ}
|
||||
SYSTEM_DEP = Makefile ioconf.c swapunix.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
|
||||
@@ -121,7 +122,7 @@ swapunix.o: swapunix.c
|
||||
all: unix.elf
|
||||
|
||||
clean:
|
||||
rm -f *.elf *.o *.map *.dis *.bin
|
||||
rm -rf .deps *.elf *.o *.map *.dis *.bin
|
||||
|
||||
clean-all: clean
|
||||
rm -f *.h *.c machine sys
|
||||
@@ -139,6 +140,9 @@ machine:
|
||||
sys:
|
||||
ln -s ../../include $@
|
||||
|
||||
.deps:
|
||||
mkdir .deps
|
||||
|
||||
startup.o: ../startup.S
|
||||
${COMPILE_S}
|
||||
|
||||
@@ -340,3 +344,7 @@ sysctl.o: $S/pic32/sysctl.c
|
||||
uart.o: $S/pic32/uart.c
|
||||
${COMPILE_C}
|
||||
|
||||
|
||||
ifeq (.deps, $(wildcard .deps))
|
||||
-include .deps/*.dep
|
||||
endif
|
||||
|
||||
@@ -8,15 +8,12 @@
|
||||
# make
|
||||
#
|
||||
architecture "pic32"
|
||||
|
||||
cpu "PIC32MX7"
|
||||
board "CHIPKIT_WF32"
|
||||
|
||||
# Linker script
|
||||
ldscript "cfg/bootloader-max32.ld"
|
||||
cpu "PIC32MX7" # Processor variant
|
||||
board "CHIPKIT_WF32" # Board type
|
||||
hz 100 # Rate of clock interrupt
|
||||
ldscript "cfg/bootloader-max32.ld" # Linker script
|
||||
|
||||
# Standard system options
|
||||
hz 100 # Rate of clock interrupt
|
||||
options "CPU_KHZ=80000" # Oscillator frequency of CPU core
|
||||
options "BUS_KHZ=80000" # Frequency of peripheral bus
|
||||
options "BUS_DIV=1" # Bus clock divisor 1/2/4/8
|
||||
|
||||
@@ -44,7 +44,8 @@ endif
|
||||
# sources are located via $S relative to the compilation directory
|
||||
S = ../..
|
||||
|
||||
DEFS = -I. ${PARAM} -DKERNEL
|
||||
DEPFLAGS = -MT $@ -MP -MD -MF .deps/$*.dep
|
||||
DEFS = -I. ${PARAM} -DKERNEL $(DEPFLAGS)
|
||||
CFLAGS = -O ${DEFS}
|
||||
|
||||
# compile rules: rules are named COMPILE_${SUFFIX}
|
||||
@@ -102,7 +103,7 @@ 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 ${SYSTEM_OBJ}
|
||||
SYSTEM_DEP = Makefile ioconf.c swapunix.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
|
||||
@@ -122,7 +123,7 @@ swapunix.o: swapunix.c
|
||||
all: unix.elf
|
||||
|
||||
clean:
|
||||
rm -f *.elf *.o *.map *.dis *.bin
|
||||
rm -rf .deps *.elf *.o *.map *.dis *.bin
|
||||
|
||||
clean-all: clean
|
||||
rm -f *.h *.c machine sys
|
||||
@@ -140,6 +141,9 @@ machine:
|
||||
sys:
|
||||
ln -s ../../include $@
|
||||
|
||||
.deps:
|
||||
mkdir .deps
|
||||
|
||||
startup.o: ../startup.S
|
||||
${COMPILE_S}
|
||||
|
||||
@@ -341,3 +345,7 @@ sysctl.o: $S/pic32/sysctl.c
|
||||
uart.o: $S/pic32/uart.c
|
||||
${COMPILE_C}
|
||||
|
||||
|
||||
ifeq (.deps, $(wildcard .deps))
|
||||
-include .deps/*.dep
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user