summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2010-01-14 17:23:58 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2010-01-14 17:23:58 +0000
commit20bcfe10e0f54cb0e53844790fdeef1e97c313d4 (patch)
treee32f21b632ecf41f2a9c9ecc3eb1876157e6b82f
parent17a7a1b54fdb078ac0bf4dd140454466fe999e22 (diff)
downloadMPC-20bcfe10e0f54cb0e53844790fdeef1e97c313d4.tar.gz
ChangeLogTag: Thu Jan 14 17:23:14 UTC 2010 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--ChangeLog24
-rw-r--r--docs/templates/common.txt1
-rw-r--r--docs/templates/make.txt3
-rw-r--r--modules/Depgen/MakeDependencyWriter.pm11
-rw-r--r--templates/make.mpd5
-rw-r--r--templates/makedll.mpt3
6 files changed, 44 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index dec4ec7d..1e0e69b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+Thu Jan 14 17:23:14 UTC 2010 Chad Elliott <elliott_c@ociweb.com>
+
+ * docs/templates/common.txt:
+
+ Documented the language template variable.
+
+ * modules/Depgen/MakeDependencyWriter.pm:
+
+ Correctly deal with whtespace in file paths. Also, convert
+ <drive letter>: to a cygwin path on Windows (even if the user
+ isn't using cygwin). Otherwise, make will fail.
+
+ * docs/templates/make.txt:
+ * templates/make.mpd:
+
+ Use DEPLIBS to cause an executable to be relinked when a static
+ library on which the executable depends is updated. This will
+ only be used if the 'gnumake' template variable is set.
+
+ * templates/makedll.mpt:
+
+ Set the 'gnumake' template variable for the linux, nucleus and
+ cygwin platforms.
+
Wed Jan 13 13:07:57 UTC 2010 Abdul Sowayan <sowayan@gmail.com>
* config/ndds_ts_defaults.mpb:
diff --git a/docs/templates/common.txt b/docs/templates/common.txt
index f5afaec8..84f5b732 100644
--- a/docs/templates/common.txt
+++ b/docs/templates/common.txt
@@ -10,6 +10,7 @@ dll_ext = The dynamic library extension. The value for this depends on the proj
exe_ext = The executable extension. The value for this depends on the project type.
forcount = The count of the number of times iteration has occurred within the current foreach loop. The base value is determined by the foreach declaration.
intermediate_dir = A configuration specific location where object files are placed.
+language = The MPC language setting at the time of project generation.
lib_ext = The static or impl library extension. The value for this depends on the project type.
lib_modifier = Used to modifier a library name. The value of this is appendend to the library name before the extension is added.
lib_prefix = The dynamic and static library prefix. The value for this depends on the project type.
diff --git a/docs/templates/make.txt b/docs/templates/make.txt
index d2e7ed33..4fc01a28 100644
--- a/docs/templates/make.txt
+++ b/docs/templates/make.txt
@@ -1,4 +1,4 @@
-// Current as of 6/17/2008
+// Current as of 1/14/2010
// This defines the role of all the template variables specific to the
// 'make' project type.
//
@@ -30,6 +30,7 @@ expanded_variable_assignment = Used to enable the setting of custom library path
extraarflags = Additional, platform specific, flags to be passed to the static library creation tool.
extracppflags = Additional, platform specific, flags to be passed to the source file compiler.
genflags = Used to determine the default compile mode (either debug or optimized).
+gnumake = Indicates that GNU Make extensions can be used in the generated Makefile.
ld = Used to override the default linker and flags for executables.
ldlibs = Platform specific libraries to be linked into dynamic libraries and executables.
libgenopt = This is used to pass an option, if necessary, to the static library creation tool to specify the library name.
diff --git a/modules/Depgen/MakeDependencyWriter.pm b/modules/Depgen/MakeDependencyWriter.pm
index 77d1cc29..2338ba99 100644
--- a/modules/Depgen/MakeDependencyWriter.pm
+++ b/modules/Depgen/MakeDependencyWriter.pm
@@ -21,7 +21,16 @@ use vars qw(@ISA);
# ************************************************************
sub process {
- ## Sort the dependencies to make them reproducible
+ ## Replace whitespace with escaped whitespace.
+ map(s/(\s)/\\$1/g, @{$_[2]});
+
+ ## Replace <drive letter>: with /cygdrive/<drive letter>. The user may
+ ## or may not be using Cygwin, but leaving the colon in there will
+ ## cause make to fail catastrophically on the next invocation.
+ map(s/([A-Z]):/\/cygdrive\/$1/gi, @{$_[2]}) if (defined $ENV{OS} &&
+ $ENV{OS} =~ /windows/i);
+
+ ## Sort the dependencies to make them reproducible.
return "@{$_[1]}: \\\n " . join(" \\\n ", sort @{$_[2]}) . "\n";
}
diff --git a/templates/make.mpd b/templates/make.mpd
index 35d56afd..d6d53d0e 100644
--- a/templates/make.mpd
+++ b/templates/make.mpd
@@ -125,6 +125,9 @@ STATICFLAGS =<%foreach(staticflags)%> -D<%staticflag%><%endfor%>
<%endif%>
EXPORTFLAGS = <%if(exename)%><%if(need_staticflags)%>$(STATICFLAGS)<%endif%><%else%><%if(dll_ext && sharedname)%>$(DYNAMICFLAGS)<%else%>$(STATICFLAGS)<%endif%><%endif%>
<%endif%>
+<%if(gnumake && exename && libpaths && need_staticflags)%>
+DEPLIBS = $(foreach lib,<%foreach(libs)%> <%libname_prefix%><%lib%><%endfor%> <%lit_libs%>, $(foreach libpath,<%foreach(libpaths)%><%if(targetoutdir)%> <%libpath%>/<%targetoutdir%><%endif%> <%libpath%><%endfor%>, $(wildcard $(libpath)/lib$(lib).a)))
+<%endif%>
<%if(multiple(configurations) || multiple(platforms))%>
endif
<%endif%>
@@ -160,7 +163,7 @@ specialscript:
<%endif%>
<%endif%>
-$(BIN):<%if(tempinc)%> $(TEMPINCDIR)<%endif%><%if(prelinktargetobj)%> <%targetoutdir%><%obj_dir%><%prelinktargetobj%><%else%><%if(prelinktarget)%> <%prelinktarget%><%endif%><%endif%> $(OBJS)
+$(BIN):<%if(tempinc)%> $(TEMPINCDIR)<%endif%><%if(prelinktargetobj)%> <%targetoutdir%><%obj_dir%><%prelinktargetobj%><%else%><%if(prelinktarget)%> <%prelinktarget%><%endif%><%endif%> $(OBJS)<%if(gnumake && exename && libpaths && need_staticflags)%> $(DEPLIBS)<%endif%>
@$(TESTDIRSTART) "$(BTARGETDIR)" $(TESTDIREND) $(MKDIR) "$(BTARGETDIR)"
<%if(prelink)%>
<%eval(prelink)%>
diff --git a/templates/makedll.mpt b/templates/makedll.mpt
index 75203d9f..f051ad7e 100644
--- a/templates/makedll.mpt
+++ b/templates/makedll.mpt
@@ -245,11 +245,13 @@ openvms {
}
linux {
+ gnumake = 1
ldlibs = -ldl $(subst lib,-l,$(sort $(basename $(notdir $(wildcard /usr/lib/librt.so /lib/librt.so))))) -lpthread
extracppflags = -D_REENTRANT
}
nucleus {
+ gnumake = 1
extracppflags = -mcpu=arm7tdmi -msoft-float -mthumb-interwork
}
@@ -323,6 +325,7 @@ vxworks_rtp {
}
cygwin {
+ gnumake = 1
versupport =
dll_ext = .dll
exe_ext = .exe