Forward the OpenWrt CPPFLAGS to the compile process. This fixes fortify sources support. Link: https://github.com/openwrt/openwrt/pull/22056 Signed-off-by: Hauke Mehrtens <[email protected]>
@@ -23,7 +23,9 @@ endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
CC="$(TARGET_CC)" \
- CFLAGS="$(TARGET_CFLAGS) -Wall"
+ CFLAGS="$(TARGET_CFLAGS) -Wall" \
+ CPPFLAGS="$(TARGET_CPPFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)"
endef
define Package/ravpower-mcu/install
@@ -0,0 +1,11 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -3,7 +3,7 @@ CFLAGS:=-I.
+ OUTDIR:=./
+
+ main: main.c
+- $(CC) -o $(OUTDIR)/ravpower-mcu main.c
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(OUTDIR)/ravpower-mcu main.c
+ clean:
+ rm ravpower-pmic