summaryrefslogtreecommitdiff
path: root/makefiles/Makefile.top
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-06-20 11:11:53 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-06-20 11:11:53 +0000
commitcd1c230244b6beb1e36f6471a89efc50ce5f6308 (patch)
tree97c6aae1ed3a59c69363077f64b5f3009ab28e91 /makefiles/Makefile.top
parentbd06b34383c2ffab55b3ad7a3ccf136b9f0596ee (diff)
downloadbuildsystem-cd1c230244b6beb1e36f6471a89efc50ce5f6308.tar.gz
buildsystem-cd1c230244b6beb1e36f6471a89efc50ce5f6308.tar.bz2
Auto-detect whether C compiler is GCC and, if it is, whether it supports simultaneous compilation and dependency generation.
Add canned rules for compilers that cannot calculate dependency information. svn path=/trunk/tools/buildsystem/; revision=7890
Diffstat (limited to 'makefiles/Makefile.top')
-rw-r--r--makefiles/Makefile.top44
1 files changed, 31 insertions, 13 deletions
diff --git a/makefiles/Makefile.top b/makefiles/Makefile.top
index 00c62b1..2e54acc 100644
--- a/makefiles/Makefile.top
+++ b/makefiles/Makefile.top
@@ -387,32 +387,50 @@ ifeq ($(CC_CAN_BUILD_AND_DEP),yes)
endef
else
- # C compiler must calculate dependencies first, then compile (default)
+ ifeq ($(CC_CANNOT_DEP),yes)
+ # C compiler cannot calculate dependencies
- define dep_c
- ifeq ($$(findstring $$(BUILDDIR)/$2,$$(DEPFILES)),)
- $$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
+ define dep_c
+ endef
+
+ define build_c
+ ifeq ($$(findstring $$(BUILDDIR)/$2,$$(BUILDFILES)),)
+ $$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
+ $$(VQ)$$(ECHO) $$(ECHOFLAGS) " COMPILE: $1"
+ $$(Q)$$(CC) $$($3) -o $$@ -c $1
+
+ BUILDFILES += $$(BUILDDIR)/$2
+ endif
+
+ endef
+ else
+ # C compiler must calculate dependencies first, then compile (default)
+
+ define dep_c
+ ifeq ($$(findstring $$(BUILDDIR)/$2,$$(DEPFILES)),)
+ $$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
$$(VQ)$$(ECHO) $$(ECHOFLAGS) " DEP: $1"
$$(Q)$$(RM) $$(RMFLAGS) $($@)
$$(Q)$$(CC) $$($3) -MM $1 > $$@.tmp
$$(Q)$$(SED) $$(SEDFLAGS) 's,^.*:,$$@ $$(@:.d=.o):,' < $$@.tmp > $$@
$$(Q)$$(RM) $$@.tmp
- DEPFILES += $$(BUILDDIR)/$2
- endif
+ DEPFILES += $$(BUILDDIR)/$2
+ endif
- endef
+ endef
- define build_c
- ifeq ($$(findstring $$(BUILDDIR)/$2,$$(BUILDFILES)),)
- $$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
+ define build_c
+ ifeq ($$(findstring $$(BUILDDIR)/$2,$$(BUILDFILES)),)
+ $$(BUILDDIR)/$2: $$(BUILDDIR)/stamp $1
$$(VQ)$$(ECHO) $$(ECHOFLAGS) " COMPILE: $1"
$$(Q)$$(CC) $$($3) -o $$@ -c $1
- BUILDFILES += $$(BUILDDIR)/$2
- endif
+ BUILDFILES += $$(BUILDDIR)/$2
+ endif
- endef
+ endef
+ endif
endif
define build_cmhg