Force rebuilding of src/drivers between hostapd and wpa_supplicant
authorJouni Malinen <j@w1.fi>
Fri, 14 Aug 2009 17:40:37 +0000 (20:40 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 14 Aug 2009 17:40:37 +0000 (20:40 +0300)
This is a (hopefully) temporary workaround to allow the same source code
tree to be used for building hostapd and wpa_supplicant without having
to manually force recompilation of some files. Currently, some of the
driver wrapper files need to be built separately for hostapd and
wpa_supplicant (#ifdef's in the files based on AP functionality).

This is somewhat racy as far as parallel make execution is concerned,
i.e., it may be necessary to run "make -j#" twice (plain "make" works
fine. Since this is supposed to be a temporary workaround, there is not
much point in trying to fix this with any more complex make processing.

hostapd/Makefile
src/drivers/.gitignore [new file with mode: 0644]
src/drivers/Makefile
wpa_supplicant/Makefile

index fe09dfe..de28dbc 100644 (file)
@@ -596,7 +596,15 @@ verify_config:
 install: all
        for i in $(ALL); do cp $$i /usr/local/bin/$$i; done
 
-hostapd: $(OBJS)
+../src/drivers/build.hostapd:
+       @if [ -e ../src/drivers/build.wpa_supplicant ]; then \
+               $(MAKE) -C ../src/drivers clean; \
+       fi
+       @touch ../src/drivers/build.hostapd
+
+BCHECK=../src/drivers/build.hostapd
+
+hostapd: $(BCHECK) $(OBJS)
        $(CC) -o hostapd $(OBJS) $(LIBS)
 
 OBJS_c = hostapd_cli.o ../src/common/wpa_ctrl.o ../src/utils/os_$(CONFIG_OS).o
diff --git a/src/drivers/.gitignore b/src/drivers/.gitignore
new file mode 100644 (file)
index 0000000..1d9e0e6
--- /dev/null
@@ -0,0 +1,2 @@
+build.wpa_supplicant
+build.hostapd
index cffba62..8da6994 100644 (file)
@@ -4,6 +4,7 @@ all:
 clean:
        for d in $(SUBDIRS); do make -C $$d clean; done
        rm -f *~ *.o *.d
+       rm -f build.wpa_supplicant build.hostapd
 
 install:
        @echo Nothing to be made.
index 15c8688..9455460 100644 (file)
@@ -1084,10 +1084,18 @@ endif
 
 dynamic_eap_methods: $(EAPDYN)
 
-wpa_priv: $(OBJS_priv)
+../src/drivers/build.wpa_supplicant:
+       @if [ -e ../src/drivers/build.hostapd ]; then \
+               $(MAKE) -C ../src/drivers clean; \
+       fi
+       @touch ../src/drivers/build.wpa_supplicant
+
+BCHECK=../src/drivers/build.wpa_supplicant
+
+wpa_priv: $(BCHECK) $(OBJS_priv)
        $(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
 
-wpa_supplicant: .config $(OBJS) $(EXTRA_progs)
+wpa_supplicant: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
        $(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
 
 eapol_test: .config $(OBJS_t)