[SLOF] [PATCH v2] lib/Makefile: Pass FLAG to make in SUBDIRS target

Murilo Opsfelder Araujo muriloo at linux.vnet.ibm.com
Fri Jun 23 22:23:25 AEST 2017

Some applications, e.g. https://maas.io/, trust on the dhcp code 93
option to reply the correct pxelinux.0 file according to client

Today, dhcp.c is compiled without DHCPARCH, which causes it not to
send client architecture in the dhcp request, i.e. dhcpd server can
reply a pxelinux.0 binary that is not intended for client

This patch makes sure client architecture is sent in the dhcp request.

Signed-off-by: Murilo Opsfelder Araujo <muriloo at linux.vnet.ibm.com>

Changes from v1:

- Do not export DHCPARCH separately from FLAG.
- Pass FLAG to make in SUBDIRS target of lib/Makefile.
- Append FLAG to CFLAGS in lib/libnet/Makefile.

 lib/Makefile        | 2 +-
 lib/libnet/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/Makefile b/lib/Makefile
index a4d4bb2..1e8bb62 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -21,7 +21,7 @@ all:  subdirs
 subdirs: $(SUBDIRS)
-	$(MAKE) -C $@ $(MAKEARG)
 # Rules for making clean:
diff --git a/lib/libnet/Makefile b/lib/libnet/Makefile
index 83ac1e5..dfefea9 100644
--- a/lib/libnet/Makefile
+++ b/lib/libnet/Makefile
@@ -16,7 +16,7 @@ ifndef TOP
 include $(TOP)/make.rules
-CFLAGS += -I. -I.. -I../libc/include -I$(TOP)/include
+CFLAGS += -I. -I.. -I../libc/include -I$(TOP)/include $(FLAG)
 SRCS =	ethernet.c ipv4.c udp.c tcp.c dns.c bootp.c dhcp.c tftp.c \
 	ipv6.c dhcpv6.c icmpv6.c ndp.c netload.c ping.c args.c

More information about the SLOF mailing list