summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-12-10 09:33:59 +0100
committerChristian Poessinger <christian@poessinger.com>2019-12-10 09:33:59 +0100
commitde12bf3757f25e61d40cae88f5ba10ee3a04db8f (patch)
tree4b12ba8772db77d9c409c2cc548356883d90399d /Makefile
parente9bf6cc7f20d93f35c2d7dc57c9a5a173fe7fc5d (diff)
parenta68d72122c3cc032b5a7b05dafc0578e64244c4f (diff)
downloadvyos-1x-de12bf3757f25e61d40cae88f5ba10ee3a04db8f.tar.gz
vyos-1x-de12bf3757f25e61d40cae88f5ba10ee3a04db8f.zip
Merge branch 'current' of github.com:vyos/vyos-1x into equuleus
* 'current' of github.com:vyos/vyos-1x: T1855, T1826: Restore support for reboot/poweroff in M minutes. vyos.config: T1764: allow for list argument to exists, in value case vyos.config: T1846: ignore edit level when obtaining working config T1843: use include files for interface proxy-arp-pvlan option T1843: use include files for interface proxy-arp configuration T1843: use include files for interface arp-cache-timeout configuration T1843: use include files for interface link-detect feature T1843: use include files for interface MTU size T1843: use include files for interface MAC address T1843: use include files to disable interface (admin down) T1843: use include files for interface description T1843: use include files for DHCP/DHCPv6 options T1843: recursively include IP address definitions in VIF/VIF-S definitions T1843: add support for recursive includes T1843: use include files for VIF/VIF-S interfaces T1843: use include files for IPv4/IPv6 interface address configuration T1843: run interface-definitions though GCC preprocessor
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 30 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 7986ccdc9..97e933694 100644
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,48 @@
TMPL_DIR := templates-cfg
OP_TMPL_DIR := templates-op
+BUILD_DIR := build
+CFLAGS :=
+
+src = $(wildcard interface-definitions/*.xml.in)
+obj = $(src:.xml.in=.xml)
+
+%.xml: %.xml.in
+ @echo Generating $(BUILD_DIR)/$@ from $<
+ # -ansi This turns off certain features of GCC that are incompatible
+ # with ISO C90. Without this regexes containing '/' as in an URL
+ # won't work
+ # -x c By default GCC guesses the input language from its file extension,
+ # thus XML is unknown. Force it to C language
+ # -E Stop after the preprocessing stage
+ # -undef Do not predefine any system-specific or GCC-specific macros.
+ # -nostdinc Do not search the standard system directories for header files
+ # -P Inhibit generation of linemarkers in the output from the
+ # preprocessor
+ @$(CC) -ansi -x c -E -undef -nostdinc -P -I$(CURDIR)/interface-definitions -o $(BUILD_DIR)/$@ -c $<
+
+$(BUILD_DIR):
+ install -d -m 0755 $(BUILD_DIR)/interface-definitions
+ install -d -m 0755 $(BUILD_DIR)/op-mode-definitions
.PHONY: interface_definitions
.ONESHELL:
-interface_definitions:
+interface_definitions: $(BUILD_DIR) $(obj)
mkdir -p $(TMPL_DIR)
- find $(CURDIR)/interface-definitions/ -type f -name "*.xml" | xargs -I {} $(CURDIR)/scripts/build-command-templates {} $(CURDIR)/schema/interface_definition.rng $(TMPL_DIR) || exit 1
+ find $(BUILD_DIR)/interface-definitions -type f -name "*.xml" | xargs -I {} $(CURDIR)/scripts/build-command-templates {} $(CURDIR)/schema/interface_definition.rng $(TMPL_DIR) || exit 1
# XXX: delete top level node.def's that now live in other packages
rm -f $(TMPL_DIR)/firewall/node.def
rm -f $(TMPL_DIR)/interfaces/node.def
rm -f $(TMPL_DIR)/interfaces/bonding/node.tag/ip/node.def
+ rm -f $(TMPL_DIR)/interfaces/bonding/node.tag/vif/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/bridge/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/ethernet/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/ethernet/node.tag/vif/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/ethernet/node.tag/vif-s/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/vxlan/node.tag/ip/node.def
+ rm -f $(TMPL_DIR)/interfaces/wireless/node.tag/vif/node.tag/ip/node.def
rm -f $(TMPL_DIR)/protocols/node.def
rm -f $(TMPL_DIR)/protocols/static/node.def
rm -f $(TMPL_DIR)/system/node.def
@@ -56,8 +81,9 @@ all: clean interface_definitions op_mode_definitions
.PHONY: clean
clean:
- rm -rf $(TMPL_DIR)/*
- rm -rf $(OP_TMPL_DIR)/*
+ rm -rf $(BUILD_DIR)
+ rm -rf $(TMPL_DIR)
+ rm -rf $(OP_TMPL_DIR)
.PHONY: test
test: