Commit f60f33c5 authored by Alessandro Rubini's avatar Alessandro Rubini

dev/ep_pfilter: use the rules that we pass at build-time

Use the rules from the array we are passed in the object file.
We'll use the feature when enabling vlans: at that point we'll have
two sets to choose from, according to run-time configuration.

Using the build-time configuration avoids the hairy ifdef and saves
almost 1kB of binary size.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 05d62aea
......@@ -56,6 +56,14 @@ CFLAGS_PLATFORM = -mmultiply-enabled -mbarrel-shift-enabled
LDFLAGS_PLATFORM = -mmultiply-enabled -mbarrel-shift-enabled \
-nostdlib -T $(LDS-y)
# packet-filter rules depend on configuration; default is rules-plain
pfilter-y := rules-plain.bin
pfilter-$(CONFIG_ETHERBONE) := rules-ebone.bin
pfilter-$(CONFIG_NIC_PFILTER) := rules-e+nic.bin
export pfilter-y
all:
include shell/shell.mk
include lib/lib.mk
include pp_printf/printf.mk
......@@ -74,6 +82,7 @@ obj-y += check-error.o
# add system check functions like stack overflow and check reset
obj-y += system_checks.o
# WR node has SDB support, WR switch does not
obj-$(CONFIG_WR_NODE) += sdb-lib/libsdbfs.a
cflags-$(CONFIG_WR_NODE) += -Isdb-lib
......@@ -148,7 +157,7 @@ $(AUTOCONF): silentoldconfig
clean:
rm -f $(OBJS) $(OUTPUT).elf $(OUTPUT).bin $(OUTPUT).ram \
$(LDS) .depend
$(LDS) rules-*.bin .depend
$(MAKE) -C $(PPSI) clean
$(MAKE) -C sdb-lib clean
$(MAKE) -C tools clean
......
obj-$(CONFIG_WR_NODE) += \
dev/endpoint.o \
dev/ep_pfilter.o \
dev/pfilter-rules.o \
dev/i2c.o \
dev/minic.o \
dev/pps_gen.o \
......@@ -19,3 +20,16 @@ obj-$(CONFIG_W1) += dev/w1.o dev/w1-hw.o dev/w1-shell.o
obj-$(CONFIG_W1) += dev/w1-temp.o dev/w1-eeprom.o
obj-$(CONFIG_UART) += dev/uart.o
obj-$(CONFIG_UART_SW) += dev/uart-sw.o
# Filter rules are selected according to configuration, see toplevel Makefile,
# but the filename is reflected in symbol names, so use a symlink here.
dev/pfilter-rules.o: $(pfilter-y)
ln -sf $(pfilter-y) rules-pfilter.bin
$(OBJCOPY) -I binary -O elf32-lm32 -B lm32 rules-pfilter.bin $@
$(pfilter-y): tools/pfilter-builder
$^
tools/pfilter-builder:
$(MAKE) -C tools pfilter-builder
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment