From 86f5c9906beac527f3d7966f24811b571a589e08 Mon Sep 17 00:00:00 2001
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Date: Sun, 22 Jan 2006 22:55:11 +0000
Subject: - add platform.h. - use shorter boilerplate while at it.

---
 Makefile | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

(limited to 'Makefile')

diff --git a/Makefile b/Makefile
index b71803d74..267f6b7b6 100644
--- a/Makefile
+++ b/Makefile
@@ -381,7 +381,7 @@ docs/busybox.net/BusyBox.html: docs/busybox.pod
 scripts/bb_mkdep: $(top_srcdir)/scripts/bb_mkdep.c
 	$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
 
-DEP_INCLUDES := include/config.h include/bb_config.h
+DEP_INCLUDES := include/config.h include/bb_config.h include/_usage.h
 
 ifeq ($(strip $(CONFIG_BBCONFIG)),y)
 DEP_INCLUDES += include/bbconfigopts.h
@@ -411,13 +411,22 @@ include/bb_config.h: include/config.h
 		< $< >> $@
 	@echo "#endif" >> $@
 
+# Create macros for usage.h, e.g.:
+#if ENABLE_HAVE_DOT_CONFIG
+#define USAGE_HAVE_DOT_CONFIG(a) a
+#else
+#define USAGE_HAVE_DOT_CONFIG(a)
+#endif
+include/_usage.h: .config
+	awk '/CONFIG|BB_APPLET/{gsub("#[[:space:]]*|=y|.*CONFIG_|.*BB_APPLET_","");if(!/=/){print("#if ENABLE_"$$1"\n#define USAGE_"$$1"(a) a\n#else\n#define USAGE_"$$1"(a)\n#endif");}}' $(<) > $(@)
+
 clean:
 	- $(MAKE) -C scripts/config $@
 	- $(RM_F) docs/busybox.dvi docs/busybox.ps \
 	    docs/busybox.pod docs/busybox.net/busybox.html \
 	    docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log \
 	    docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
-	    docs/busybox.net/BusyBox.html busybox.links libbb/loop.h \
+	    docs/busybox.net/BusyBox.html busybox.links include/_usage.h \
 	    $(DO_INSTALL_LIBS) $(LIBBUSYBOX_SONAME) \
 	    .config.old busybox
 	- rm -rf _install testsuite/links
-- 
cgit v1.2.3