diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2003-04-09 19:11:40 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2003-04-09 19:11:40 +0000 |
commit | 9a3d0d794702c7e1212989fca138f5e27d74189d (patch) | |
tree | f423d97462ede18d060f60c376b1809adf18b284 | |
parent | 2b6a9eb58f2ade3cf4ca10af755be09b4f67d65c (diff) | |
download | MPC-9a3d0d794702c7e1212989fca138f5e27d74189d.tar.gz |
ChangeLogTag: Wed Apr 9 14:10:42 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r-- | modules/MakeWorkspaceCreator.pm | 14 | ||||
-rw-r--r-- | templates/make.mpd | 25 |
2 files changed, 34 insertions, 5 deletions
diff --git a/modules/MakeWorkspaceCreator.pm b/modules/MakeWorkspaceCreator.pm index 2f67e6eb..99675f87 100644 --- a/modules/MakeWorkspaceCreator.pm +++ b/modules/MakeWorkspaceCreator.pm @@ -74,12 +74,22 @@ sub write_comps { ## If there is more than one project, use a for loop if ($#list > 0) { print $fh "\t\@for file in \$(MFILES); do \\$crlf" . - "\t\$(MAKE) -f \$\$file \$(\@); \\$crlf" . + "\told=`pwd`; \\$crlf" . + "\tcd `dirname \$\$file`; \\$crlf" . + "\t\$(MAKE) -f `basename \$\$file` \$(\@); \\$crlf" . + "\tcd \$\$old; \\$crlf" . "\tdone$crlf"; } else { ## Otherwise, just list the call to make without a for loop - print $fh "\t\@\$(MAKE) -f " . $list[0] . " \$(\@);$crlf"; + print $fh "\t\@"; + my($dname) = dirname($list[0]); + if ($dname ne '.') { + print $fh "cd $dname && "; + } + print $fh "\$(MAKE) -f " . + ($dname eq '.' ? $list[0] : basename($list[0])) . + " \$(\@);$crlf"; } } diff --git a/templates/make.mpd b/templates/make.mpd index 766e8d33..219b65c1 100644 --- a/templates/make.mpd +++ b/templates/make.mpd @@ -48,20 +48,20 @@ OUTPUT_OPTION = -o $@ <%marker(local)%> <%if(exename)%> -all: $(BIN) +all: $(BIN) <%if(install)%>install<%endif%> $(BIN): $(OBJS) $(LINK.cc) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS) <%endif%> <%if(sharedname)%> -all: $(SHLIB) +all: $(SHLIB) <%if(install)%>install<%endif%> $(SHLIB): $(OBJS) $(LINK.cc) $(SHFLAGS) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS) <%endif%> -<%if(sharedname)%> +<%if(staticname)%> $(LIB): $(OBJS) $(AR) $(ARFLAGS) $(LIB) $(OBJS) @@ -69,6 +69,25 @@ $(LIB): $(OBJS) %.o: %.cpp $(COMPILE.cc) $< $(OUTPUT_OPTION) +<%if(install)%> +<%if(exename)%> +INSTARGET = $(BIN) +<%else%> +<%if(sharedname)%> +INSTARGET = $(SHLIB) +<%else%> +<%if(staticname)%> +INSTARGET = $(LIB) +<%endif%> +<%endif%> +<%endif%> +install: + @echo "Installing $(INSTARGET) -> <%install%>/$(INSTARGET)" + @mkdir -p "<%install%>" + @$(RM) "<%install%>/$(INSTARGET)" + @ln -s "$(PWD)/$(INSTARGET)" "<%install%>" + +<%endif%> clean: -$(RM) $(OBJS) |