Commit 49d5fe99 authored by Alessandro Rubini's avatar Alessandro Rubini

Merge branch 'pfilter-cleanup'

parents fc7febc7 808ffdd2
......@@ -14,6 +14,7 @@ SIZE = $(CROSS_COMPILE)size
AUTOCONF = $(CURDIR)/include/generated/autoconf.h
PPSI = ppsi
PPSI_CONFIG = ppsi/include/generated/autoconf.h
# we miss CONFIG_ARCH_LM32 as we have no other archs by now
obj-y = arch/lm32/crt0.o arch/lm32/irq.o
......@@ -55,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
......@@ -73,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
......@@ -138,22 +148,23 @@ config.o: .config
./tools/genraminit $*.bin 0 > $@
%.vhd: tools %.bin
./tools/genramvhd -s `. ./.config; echo $$CONFIG_RAMSIZE` $*.bin > $@
./tools/genramvhd -s $(CONFIG_RAMSIZE) $*.bin > $@
%.mif: tools %.bin
./tools/genrammif $*.bin `. ./.config; echo $$CONFIG_RAMSIZE` > $@
./tools/genrammif $*.bin $(CONFIG_RAMSIZE) > $@
$(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
%.o: %.c
${CC} $(CFLAGS) $(PTPD_CFLAGS) $(INCLUDE_DIR) $(LIB_DIR) -c $*.c -o $@
${CC} $(CFLAGS) $(PTPD_CFLAGS) $(INCLUDE_DIR) $(LIB_DIR) \
-include $(PPSI_CONFIG) -c $*.c -o $@
tools:
$(MAKE) -C tools
......@@ -186,4 +197,4 @@ defconfig:
.depend: $(wildcard *.c [^pt]/*.c)
$(CC) $(CFLAGS) -DSDBFS_BIG_ENDIAN -MM $^ > $@
-include .depend
\ No newline at end of file
-include .depend
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.
......@@ -8,3 +8,4 @@ eb-w1-write
sdb-wrpc.bin
flash-read
flash-write
pfilter-builder
......@@ -5,6 +5,7 @@ CFLAGS = -Wall -ggdb -I../include
LDFLAGS = -lutil
ALL = genraminit genramvhd genrammif wrpc-uart-sw
ALL += wrpc-w1-read wrpc-w1-write
ALL += pfilter-builder
ifneq ($(EB),no)
ALL += eb-w1-write
......
......@@ -42,12 +42,12 @@ void help()
}
/* We don't want localized versions from ctype.h */
inline int my_isalpha(char c)
static int my_isalpha(char c)
{
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}
inline int my_isok(char c)
static int my_isok(char c)
{
return c == '_' || my_isalpha(c) || (c >= '0' && c <= '9');
}
......@@ -124,9 +124,12 @@ int main(int argc, char **argv)
fprintf(stderr,
"%s: expecting one non-optional argument: <filename>\n",
program);
return 1;
error = 1;
}
if (error)
return 1;
filename = argv[optind];
/* Confirm the filename exists */
......
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