Use generated include-bridges for Makefiles
This commit is contained in:
parent
199dfaffbc
commit
575f1a7d42
|
@ -5,6 +5,13 @@ true
|
||||||
# echo $1
|
# echo $1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if test ! -d simulat0r/firmware -o ! -d firmware
|
||||||
|
then
|
||||||
|
echo ERROR:
|
||||||
|
echo This script must be run from toplevel r0ket directory
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Updating directories"
|
echo "Updating directories"
|
||||||
for i in `find firmware/ -type d `
|
for i in `find firmware/ -type d `
|
||||||
do
|
do
|
||||||
|
@ -14,7 +21,7 @@ else mkdir -v simulat0r/$i
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Updating bridge files"
|
echo "Updating bridge files for C source"
|
||||||
for i in `find firmware/ \! -path firmware/lcd/allfonts.h -type f -iname \*.[ch]`
|
for i in `find firmware/ \! -path firmware/lcd/allfonts.h -type f -iname \*.[ch]`
|
||||||
do
|
do
|
||||||
if test -f simulat0r/$i;
|
if test -f simulat0r/$i;
|
||||||
|
@ -25,3 +32,15 @@ do
|
||||||
(printf "/* AUTOGENERATED SOURCE FILE */\n"; echo \#include \"`dirname $i | sed "s#[^/]*#..#g" `/../$i\") >simulat0r/$i
|
(printf "/* AUTOGENERATED SOURCE FILE */\n"; echo \#include \"`dirname $i | sed "s#[^/]*#..#g" `/../$i\") >simulat0r/$i
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "Updating bridge files for Makefiles"
|
||||||
|
for i in `find firmware/ -type f -iname Makefile`
|
||||||
|
do
|
||||||
|
if test -f simulat0r/$i;
|
||||||
|
then
|
||||||
|
verbmsg "OK File already exists: $i"
|
||||||
|
else
|
||||||
|
echo Writing bridge file simulat0r/$i
|
||||||
|
(printf "# GENERATED INCLUDE BRIDGE/\n"; echo include `dirname $i | sed "s#[^/]*#..#g" `/../$i) >simulat0r/$i
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
|
@ -1,66 +1,2 @@
|
||||||
##########################################################################
|
# GENERATED INCLUDE BRIDGE/
|
||||||
# User configuration and firmware specific object files
|
include ../../../firmware/applications/Makefile
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
OBJS = default.o
|
|
||||||
OBJS += $(foreach mod,$(APP),$(mod).o)
|
|
||||||
|
|
||||||
SRCS = $(foreach mod,$(APP),$(mod).c)
|
|
||||||
|
|
||||||
ifndef APP
|
|
||||||
ME_OBJ=$(USERNAME)
|
|
||||||
|
|
||||||
ifeq "$(ME_OBJ)" ""
|
|
||||||
ME_OBJ=$(USER)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq "$(ME_OBJ)" ""
|
|
||||||
ME_OBJ=nouser
|
|
||||||
endif
|
|
||||||
|
|
||||||
OBJS += $(ME_OBJ).o
|
|
||||||
endif
|
|
||||||
|
|
||||||
WRAP=wrapper
|
|
||||||
LIBNAME=app
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# GNU GCC compiler flags
|
|
||||||
##########################################################################
|
|
||||||
ROOT_PATH?= ..
|
|
||||||
INCLUDE_PATHS = -I$(ROOT_PATH) -I../core -I.
|
|
||||||
|
|
||||||
include $(ROOT_PATH)/Makefile.inc
|
|
||||||
|
|
||||||
WRAPOBJ=$(WRAP).o
|
|
||||||
WRAPSRC=$(WRAP).c
|
|
||||||
LIBFILE=lib$(LIBNAME).a
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# Compiler settings, parameters and flags
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
all: $(LIBFILE)
|
|
||||||
|
|
||||||
$(LIBFILE): $(OBJS) $(WRAPOBJ)
|
|
||||||
$(AR) rcs $@ $(OBJS) $(WRAPOBJ)
|
|
||||||
|
|
||||||
%.o : %.c
|
|
||||||
$(CC) $(CFLAGS) -o $@ $<
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(OBJS) $(WRAPOBJ) $(WRAPSRC) $(LIBFILE) *.o
|
|
||||||
|
|
||||||
%.c:
|
|
||||||
@echo
|
|
||||||
@echo "You need to create $@ first"
|
|
||||||
@echo "It should contain a single function void main_filename(void)"
|
|
||||||
@echo
|
|
||||||
@exit 1
|
|
||||||
|
|
||||||
$(WRAPSRC):
|
|
||||||
./mkwrapper $(OBJS) > $@
|
|
||||||
|
|
||||||
.PHONY: $(LIBFILE) $(WRAPSRC) $(SRCS)
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
|
|
|
@ -1,56 +1,2 @@
|
||||||
##########################################################################
|
# GENERATED INCLUDE BRIDGE/
|
||||||
# User configuration and firmware specific object files
|
include ../../../firmware/core/Makefile
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
# The target, flash and ram of the LPC1xxx microprocessor.
|
|
||||||
# Use for the target the value: LPC11xx, LPC13xx or LPC17xx
|
|
||||||
TARGET = LPC13xx
|
|
||||||
|
|
||||||
OBJS = sysinit.o
|
|
||||||
OBJS += adc/adc.o
|
|
||||||
#OBJS += cmd/cmd.o
|
|
||||||
OBJS += cpu/cpu.o
|
|
||||||
OBJS += gpio/gpio.o
|
|
||||||
OBJS += i2c/i2c.o
|
|
||||||
OBJS += iap/iap.o
|
|
||||||
OBJS += libc/ctype.o
|
|
||||||
OBJS += libc/stdio.o
|
|
||||||
OBJS += libc/string.o
|
|
||||||
OBJS += pmu/pmu.o
|
|
||||||
#OBJS += pwm/pwm.o
|
|
||||||
OBJS += ssp/ssp.o
|
|
||||||
OBJS += systick/systick.o
|
|
||||||
OBJS += timer16/timer16.o
|
|
||||||
OBJS += timer32/timer32.o
|
|
||||||
#OBJS += uart/uart.o
|
|
||||||
#OBJS += uart/uart_buf.o
|
|
||||||
#OBJS += usbcdc/cdcuser.o
|
|
||||||
#OBJS += usbcdc/cdc_buf.o
|
|
||||||
#OBJS += usbcdc/usbcore.o
|
|
||||||
#OBJS += usbcdc/usbdesc.o
|
|
||||||
#OBJS += usbcdc/usbhw.o
|
|
||||||
#OBJS += usbcdc/usbuser.o
|
|
||||||
OBJS += wdt/wdt.o
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# GNU GCC compiler flags
|
|
||||||
##########################################################################
|
|
||||||
ROOT_PATH?= ..
|
|
||||||
INCLUDE_PATHS = -I$(ROOT_PATH) -I.
|
|
||||||
|
|
||||||
include $(ROOT_PATH)/Makefile.inc
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# Compiler settings, parameters and flags
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
all: libcore.a
|
|
||||||
|
|
||||||
libcore.a: $(OBJS)
|
|
||||||
$(AR) rcs libcore.a $(OBJS)
|
|
||||||
|
|
||||||
%.o : %.c projectconfig.h
|
|
||||||
$(CC) $(CFLAGS) -o $@ $<
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(OBJS) libcore.a
|
|
||||||
|
|
|
@ -1,30 +1,2 @@
|
||||||
##########################################################################
|
# GENERATED INCLUDE BRIDGE/
|
||||||
# User configuration and firmware specific object files
|
include ../../../firmware/filesystem/Makefile
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
OBJS =
|
|
||||||
|
|
||||||
OBJS += ff.o
|
|
||||||
OBJS += diskio.o
|
|
||||||
OBJS += iobase.o
|
|
||||||
OBJS += mmc.o
|
|
||||||
OBJS += at45db041d.o
|
|
||||||
OBJS += util.o
|
|
||||||
OBJS += select.o
|
|
||||||
OBJS += execute.o
|
|
||||||
|
|
||||||
LIBNAME=fat
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# GNU GCC compiler flags
|
|
||||||
##########################################################################
|
|
||||||
ROOT_PATH?= ..
|
|
||||||
INCLUDE_PATHS = -I$(ROOT_PATH) -I../core -I.
|
|
||||||
|
|
||||||
include $(ROOT_PATH)/Makefile.inc
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# Actual work
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
include $(ROOT_PATH)/Makefile.util
|
|
||||||
|
|
|
@ -1,25 +1,2 @@
|
||||||
##########################################################################
|
# GENERATED INCLUDE BRIDGE/
|
||||||
# User configuration and firmware specific object files
|
include ../../../firmware/funk/Makefile
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
OBJS =
|
|
||||||
|
|
||||||
OBJS += nrf24l01p.o
|
|
||||||
OBJS += rftransfer.o
|
|
||||||
OBJS += filetransfer.o
|
|
||||||
|
|
||||||
LIBNAME=funk
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# GNU GCC compiler flags
|
|
||||||
##########################################################################
|
|
||||||
ROOT_PATH?= ..
|
|
||||||
INCLUDE_PATHS = -I$(ROOT_PATH) -I../core -I.
|
|
||||||
|
|
||||||
include $(ROOT_PATH)/Makefile.inc
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# Actual work
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
include $(ROOT_PATH)/Makefile.util
|
|
||||||
|
|
|
@ -1,45 +1,2 @@
|
||||||
##########################################################################
|
# GENERATED INCLUDE BRIDGE/
|
||||||
# User configuration and firmware specific object files
|
include ../../../firmware/lcd/Makefile
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
OBJS =
|
|
||||||
|
|
||||||
OBJS += display.o
|
|
||||||
OBJS += render.o
|
|
||||||
OBJS += decoder.o
|
|
||||||
OBJS += backlight.o
|
|
||||||
OBJS += print.o
|
|
||||||
|
|
||||||
FONTS = $(basename $(wildcard fonts/*.c))
|
|
||||||
|
|
||||||
LIBNAME=lcd
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# GNU GCC compiler flags
|
|
||||||
##########################################################################
|
|
||||||
ROOT_PATH?= ..
|
|
||||||
INCLUDE_PATHS = -I$(ROOT_PATH) -I../core -I.
|
|
||||||
|
|
||||||
include $(ROOT_PATH)/Makefile.inc
|
|
||||||
|
|
||||||
FOBJS= $(foreach ft,$(FONTS),$(ft).o)
|
|
||||||
OBJS+= $(FOBJS)
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# Actual work
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
include $(ROOT_PATH)/Makefile.util
|
|
||||||
|
|
||||||
all: allfonts.h
|
|
||||||
|
|
||||||
$(FOBJS): $(foreach ft,$(FONTS),$(ft).h) fonts.h
|
|
||||||
|
|
||||||
clean::
|
|
||||||
rm -f fonts/*.o allfonts.h
|
|
||||||
touch allfonts.h
|
|
||||||
|
|
||||||
.PHONY: allfonts.h
|
|
||||||
|
|
||||||
allfonts.h:
|
|
||||||
(echo "#include <lcd/fonts.h>";for a in $(FONTS) ; do echo "#include <lcd/$$a.h>"; done) > $@
|
|
||||||
|
|
|
@ -1,12 +1,2 @@
|
||||||
# Make doesn't allow dependencies on parent directory, so we need to
|
# GENERATED INCLUDE BRIDGE/
|
||||||
# run make from one level up:
|
include ../../../firmware/loadable/Makefile
|
||||||
|
|
||||||
MAKEFILE=loadable/Makefile.sub
|
|
||||||
MAKE+=--no-print-directory
|
|
||||||
|
|
||||||
all:
|
|
||||||
@cd .. && $(MAKE) -f $(MAKEFILE)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@cd .. && $(MAKE) -f $(MAKEFILE) clean
|
|
||||||
|
|
||||||
|
|
|
@ -1,57 +0,0 @@
|
||||||
DIR?= loadable
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# User configuration and firmware specific object files
|
|
||||||
##########################################################################
|
|
||||||
SRCS = $(wildcard $(DIR)/*.c)
|
|
||||||
OBJS = $(foreach mod,$(SRCS),$(subst .c,.o,$(mod)))
|
|
||||||
ELFS = $(foreach mod,$(SRCS),$(subst .c,.elf,$(mod)))
|
|
||||||
BINS = $(foreach mod,$(SRCS),$(subst .c,.bin,$(mod)))
|
|
||||||
HDRS = $(foreach mod,$(SRCS),$(subst .c,.h,$(mod)))
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# GNU GCC compiler flags
|
|
||||||
##########################################################################
|
|
||||||
ROOT_PATH?= .
|
|
||||||
|
|
||||||
INCLUDE_PATHS = -I$(ROOT_PATH) -I$(ROOT_PATH)/core
|
|
||||||
|
|
||||||
include $(ROOT_PATH)/Makefile.inc
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# Compiler settings, parameters and flags
|
|
||||||
##########################################################################
|
|
||||||
FIRMWARE=$(ROOT_PATH)/$(OUTFILE).elf
|
|
||||||
LDSRCFILE=$(DIR)/ram.ld
|
|
||||||
LDFILE=$(DIR)/loadable.ld
|
|
||||||
CFLAGS+=-mlong-calls -fno-toplevel-reorder
|
|
||||||
LDFLAGS+= -R $(FIRMWARE)
|
|
||||||
|
|
||||||
all: $(OBJS) $(ELFS) $(BINS) $(HDRS)
|
|
||||||
|
|
||||||
$(LDFILE):
|
|
||||||
-@echo "MEMORY" > $(LDFILE)
|
|
||||||
-@echo "{" >> $(LDFILE)
|
|
||||||
-@echo " sram(rwx): ORIGIN = 0x10002000 - $(RAMCODE), LENGTH = $(RAMCODE)" >> $(LDFILE)
|
|
||||||
-@echo "}" >> $(LDFILE)
|
|
||||||
-@echo "INCLUDE $(LDSRCFILE)" >> $(LDFILE)
|
|
||||||
|
|
||||||
%.o : %.c
|
|
||||||
$(CC) $(CFLAGS) -o $@ $<
|
|
||||||
|
|
||||||
%.elf: %.o $(FIRMWARE) $(LDFILE)
|
|
||||||
$(LD) $(LDFLAGS) -T $(LDFILE) -o $@ $<
|
|
||||||
$(SIZE) $@
|
|
||||||
|
|
||||||
%.bin: %.elf
|
|
||||||
$(OBJCOPY) $(OCFLAGS) -O binary $< $@
|
|
||||||
|
|
||||||
%.h: %.bin $(DIR)/bin2h.pl
|
|
||||||
$(DIR)/bin2h.pl $<
|
|
||||||
|
|
||||||
clean:
|
|
||||||
cd $(DIR) && rm -f *.o *.elf *.bin
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
|
|
||||||
.PHONY: $(LDFILE)
|
|
|
@ -1,36 +1,2 @@
|
||||||
##########################################################################
|
# GENERATED INCLUDE BRIDGE/
|
||||||
# User configuration and firmware specific object files
|
include ../../../firmware/usb/Makefile
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
OBJS =
|
|
||||||
|
|
||||||
OBJS += usbconfig.o
|
|
||||||
OBJS += usbhid.o
|
|
||||||
OBJS += usbmsc.o
|
|
||||||
|
|
||||||
LIBNAME=usb
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# GNU GCC compiler flags
|
|
||||||
##########################################################################
|
|
||||||
ROOT_PATH?= ..
|
|
||||||
INCLUDE_PATHS = -I$(ROOT_PATH) -I../core -I.
|
|
||||||
|
|
||||||
include $(ROOT_PATH)/Makefile.inc
|
|
||||||
|
|
||||||
LIBFILE=lib$(LIBNAME).a
|
|
||||||
##########################################################################
|
|
||||||
# Compiler settings, parameters and flags
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
all: $(LIBFILE)
|
|
||||||
|
|
||||||
$(LIBFILE): $(OBJS)
|
|
||||||
$(AR) rcs $@ $(OBJS)
|
|
||||||
|
|
||||||
%.o : %.c
|
|
||||||
$(CC) $(CFLAGS) -o $@ $<
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(OBJS) $(LIBFILE)
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue