diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2003-09-25 17:09:28 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2003-09-25 17:09:28 +0000 |
commit | 31e1303a9fee8942b3daede4065851d86dd29618 (patch) | |
tree | ff1de767d889e7b71f1fed80e89c86166b861863 | |
parent | 67b393bc59738aa041d3b5b5f9eb82d971f254eb (diff) | |
download | MPC-31e1303a9fee8942b3daede4065851d86dd29618.tar.gz |
ChangeLogTag: Thu Sep 25 12:05:22 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r-- | modules/TemplateParser.pm | 28 | ||||
-rw-r--r-- | modules/VC6WorkspaceCreator.pm | 5 | ||||
-rw-r--r-- | modules/VC7WorkspaceCreator.pm | 5 | ||||
-rw-r--r-- | templates/em3.mpd | 2 | ||||
-rw-r--r-- | templates/em3vcp.mpd | 2 | ||||
-rw-r--r-- | templates/make.mpd | 93 | ||||
-rw-r--r-- | templates/makedll.mpt | 46 | ||||
-rw-r--r-- | templates/nmake.mpd | 4 | ||||
-rw-r--r-- | templates/vc6.mpd | 2 | ||||
-rw-r--r-- | templates/vc6dsp.mpd | 2 | ||||
-rw-r--r-- | templates/vc7.mpd | 4 |
11 files changed, 134 insertions, 59 deletions
diff --git a/modules/TemplateParser.pm b/modules/TemplateParser.pm index 621d39fb..43d878a7 100644 --- a/modules/TemplateParser.pm +++ b/modules/TemplateParser.pm @@ -501,7 +501,7 @@ sub handle_if { if (!$self->{'if_skip'}) { my($true) = 1; push(@{$self->{'sstack'}}, $name); - if ($val =~ /^!(.*)/) { + if ($val !~ /\|\|/ && $val =~ /^!(.*)/) { $val = $1; $val =~ s/^\s+//; $true = 0; @@ -511,7 +511,31 @@ sub handle_if { $val = $self->get_flag_overrides($1, $2); } else { - $val = $self->get_value($val) + if ($val =~ /\|\|/) { + my($str) = $val; + $val = undef; + foreach my $v (split(/\s*\|\|\s*/, $str)) { + my($p) = 0; + if ($v =~ /^!(.*)/) { + $p = $self->get_value($v); + if (defined $p) { + $p = undef; + } + else { + $p = 'some value'; + } + } + else { + $p = $self->get_value($v); + } + if (defined $p && $p ne '') { + $val = $p; + } + } + } + else { + $val = $self->get_value($val) + } } if (defined $val) { diff --git a/modules/VC6WorkspaceCreator.pm b/modules/VC6WorkspaceCreator.pm index 92ac7e88..f3783754 100644 --- a/modules/VC6WorkspaceCreator.pm +++ b/modules/VC6WorkspaceCreator.pm @@ -46,11 +46,13 @@ sub pre_workspace { $crlf; } + sub allow_duplicates { - my($self) = shift; + #my($self) = shift; return 0; } + sub write_comps { my($self) = shift; my($fh) = shift; @@ -88,7 +90,6 @@ sub write_comps { print $fh "}}}$crlf$crlf"; } - } diff --git a/modules/VC7WorkspaceCreator.pm b/modules/VC7WorkspaceCreator.pm index 62d4e104..521939a6 100644 --- a/modules/VC7WorkspaceCreator.pm +++ b/modules/VC7WorkspaceCreator.pm @@ -22,11 +22,6 @@ use vars qw(@ISA); # Subroutine Section # ************************************************************ -sub allow_duplicates { - my($self) = shift; - return 0; -} - sub crlf { my($self) = shift; return $self->windows_crlf(); diff --git a/templates/em3.mpd b/templates/em3.mpd index 3692486f..5cdc47fc 100644 --- a/templates/em3.mpd +++ b/templates/em3.mpd @@ -91,6 +91,7 @@ LIB32=link.exe -lib # Name "<%project_name%> - <%platform%> (<%platform_long%>) <%configuration%>" <%endfor%> <%endfor%> +<%if(exename || sharedname || staticname)%> # Begin Group "Source Files" # PROP Default_Filter "cpp;cxx;c" @@ -110,6 +111,7 @@ SOURCE=".\<%source_file%>" # End Source File <%endfor%> # End Group +<%endif%> <%if(header_files)%> # Begin Group "Header Files" diff --git a/templates/em3vcp.mpd b/templates/em3vcp.mpd index 3692486f..5cdc47fc 100644 --- a/templates/em3vcp.mpd +++ b/templates/em3vcp.mpd @@ -91,6 +91,7 @@ LIB32=link.exe -lib # Name "<%project_name%> - <%platform%> (<%platform_long%>) <%configuration%>" <%endfor%> <%endfor%> +<%if(exename || sharedname || staticname)%> # Begin Group "Source Files" # PROP Default_Filter "cpp;cxx;c" @@ -110,6 +111,7 @@ SOURCE=".\<%source_file%>" # End Source File <%endfor%> # End Group +<%endif%> <%if(header_files)%> # Begin Group "Header Files" diff --git a/templates/make.mpd b/templates/make.mpd index f55d1477..243d07de 100644 --- a/templates/make.mpd +++ b/templates/make.mpd @@ -7,21 +7,21 @@ CXX = <%cxx%> <%endfor%> CCC = $(CXX) MAKEFILE = <%project_file%> -DEPENDENCIES = .depend.<%project_file%> +DEPENDENCIES = .depend.$(MAKEFILE) <%if(exename)%> BIN = <%exename%> <%endif%> <%if(staticname)%> LIB = lib<%staticname%>.a <%endif%> +<%foreach(platforms)%> +<%if(soext)%> <%if(sharedname)%> SHLIB = lib<%sharedname%>.$(SOEXT) -<%foreach(platforms)%> SOEXT = <%soext%> -<%endfor%> <%foreach(configurations)%> <%if(pic)%> -CPPFLAGS += <%pic%> +PICFLAGS = <%pic%> <%endif%> <%endfor%> <%foreach(platforms)%> @@ -30,46 +30,25 @@ SHFLAGS = <%shflags%> <%endif%> <%endfor%> <%endif%> -<%foreach(configurations)%> -<%if(cppflags)%> -CPPFLAGS += <%cppflags%> <%endif%> <%endfor%> -<%if(pch_header)%> -CPPFLAGS +=<%foreach(pch_defines)%> -D<%pch_define%><%endfor%> +<%foreach(configurations)%> +<%if(tempinc)%> +TEMPINCDIR = <%tempinc%>/<%project_name%> <%endif%> +<%endfor%> +CPPFLAGS = $(PICFLAGS)<%if(cppflags)%> <%cppflags%><%endif%><%foreach(configurations)%><%if(tempinc)%> <%tempincopt%>$(TEMPINCDIR)<%endif%><%endfor%><%foreach(platforms)%><%if(extraflags)%> <%extraflags%><%endif%><%endfor%><%if(pch_header)%><%foreach(pch_defines)%> -D<%pch_define%><%endfor%><%endif%><%if(includes)%><%foreach(includes)%> -I<%include%><%endfor%><%endif%><%if(macros)%><%foreach(macros)%> -D<%macro%><%endfor%><%endif%> <%if(idl_files)%> IDL_FILES =<%foreach(idl_files)%> <%noextension(idl_file)%><%endfor%> IDL_SRC =<%foreach(idl_files)%> <%noextension(idl_file)%>C.cpp <%noextension(idl_file)%>S.cpp<%endfor%> <%endif%> SRC =<%foreach(source_files)%> <%source_file%><%endfor%> OBJS =<%foreach(source_files)%> <%noextension(source_file)%>.o<%endfor%> -<%if(includes)%> -CPPFLAGS +=<%foreach(includes)%> -I<%include%><%endfor%> -<%endif%> -<%if(macros)%> -CPPFLAGS +=<%foreach(macros)%> -D<%macro%><%endfor%> -<%endif%> -<%if(libpaths)%> -LDFLAGS +=<%foreach(libpaths)%> -L<%libpath%><%endfor%> -<%endif%> -<%foreach(configurations)%> -<%if(linkflags)%> -LDFLAGS += <%linkflags%> -<%endif%> -<%endfor%> -<%foreach(platforms)%> -LDLIBS += <%ldlibs%> -<%endfor%> -<%if(libs)%> -LDLIBS +=<%foreach(libs)%> -l<%lib%><%endfor%> -<%endif%> -<%if(defaultlibs)%> -LDLIBS +=<%foreach(defaultlibs)%> -l<%defaultlib%><%endfor%> -<%endif%> -<%if(lit_libs)%> -LDLIBS +=<%foreach(lit_libs)%> -l<%lit_lib%><%endfor%> -<%endif%> +LDFLAGS =<%if(libpaths)%><%foreach(libpaths)%> -L<%libpath%><%endfor%><%endif%><%foreach(configurations)%><%if(linkflags)%> <%linkflags%><%endif%><%endfor%> +LDLIBS =<%foreach(platforms)%> <%ldlibs%><%endfor%><%if(libs)%><%foreach(libs)%> -l<%lib%><%endfor%><%endif%><%if(defaultlibs)%><%foreach(defaultlibs)%> -l<%defaultlib%><%endfor%><%endif%><%if(lit_libs)%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%><%endif%> +LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS) +COMPILE.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) -c +RM = rm -f OUTPUT_OPTION = -o $@ <%marker(macros)%> @@ -79,6 +58,7 @@ OUTPUT_OPTION = -o $@ <%marker(local)%> <%if(custom_types)%> +GENERATED_DIRTY =<%foreach(custom_types)%><%foreach(custom_type->input_files)%><%if(custom_type->input_file->output_files)%><%foreach(custom_type->input_file->output_files)%> <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%endfor%><%endif%><%endfor%><%endfor%> <%foreach(custom_types)%> <%if(custom_types->libpath)%> LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):<%custom_type->libpath%> @@ -89,7 +69,6 @@ PATH := $(PATH):<%custom_type->libpath%> <%endif%> <%foreach(custom_type->input_files)%> <%if(custom_type->input_file->output_files)%> -GENERATED_DIRTY +=<%foreach(custom_type->input_file->output_files)%> <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%endfor%> <%foreach(custom_type->input_file->output_files)%> <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%>: <%custom_type->input_file%> <%custom_type->command%> <%if(pch_header)%><%if(custom_type->pch_option)%><%custom_type->pch_option%><%pch_header%> <%endif%><%endif%><%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> <%custom_type->input_file%> <%if(custom_type->output_option)%><%custom_type->output_option%> $@<%endif%> @@ -100,9 +79,18 @@ GENERATED_DIRTY +=<%foreach(custom_type->input_file->output_files)%> <%if(flag_o <%endfor%> .PRECIOUS: $(GENERATED_DIRTY) all: $(GENERATED_DIRTY) -<%source_files%>: $(GENERATED_DIRTY) +$(SRC): $(GENERATED_DIRTY) + +<%endif%> +<%foreach(configurations)%> +<%if(tempinc)%> +all: $(TEMPINCDIR) + +$(TEMPINCDIR): + @-test -d $(TEMPINCDIR) || mkdir -p $(TEMPINCDIR) 2> /dev/null || true <%endif%> +<%endfor%> <%if(exename)%> all: $(BIN) <%if(install)%>install<%endif%> @@ -110,31 +98,36 @@ $(BIN): $(OBJS) $(LINK.cc) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS) <%endif%> +<%foreach(platforms)%> +<%if(soext)%> <%if(sharedname)%> INSTARGET = $(SHLIB) all: $(INSTARGET) <%if(install)%>install<%else%><%if(!exename)%>install<%endif%><%endif%> + +$(SHLIB): $(OBJS) + <%foreach(configurations)%><%foreach(platforms)%><%if(dld)%><%dld%> $(LDFLAGS)<%else%>$(LINK.cc)<%endif%><%endfor%><%endfor%> $(SHFLAGS) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS) + +<%endif%> <%else%> <%if(staticname)%> INSTARGET = $(LIB) all: $(INSTARGET) <%if(install)%>install<%else%><%if(!exename)%>install<%endif%><%endif%> -<%endif%> -<%endif%> - -<%if(sharedname)%> -$(SHLIB): $(OBJS) - $(LINK.cc) $(SHFLAGS) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS) <%endif%> +<%endif%> +<%endfor%> <%if(staticname)%> $(LIB): $(OBJS) - $(AR) $(ARFLAGS) $(LIB) $(OBJS) + $(AR) $(ARFLAGS) $(LIB) $(OBJS)<%foreach(configurations)%><%if(tempinc)%> `find $(TEMPINCDIR) -type f`<%endif%><%endfor%> <%endif%> -%.o: %.cpp - $(COMPILE.cc) $< $(OUTPUT_OPTION) +<%foreach(source_files)%> +<%noextension(source_file)%>.o: <%source_file%> + $(COMPILE.cc) <%source_file%> $(OUTPUT_OPTION) +<%endfor%> <%if(install)%> <%if(exename)%> INSTARGET = $(BIN) @@ -149,7 +142,9 @@ install: <%if(!exename)%> install: @mkdir -p "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>" - @[ -f "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>/$(INSTARGET)" ] || ln -s "$(PWD)/$(INSTARGET)" "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>" + @$(RM) "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>/$(INSTARGET)" + @ln -s "$(PWD)/$(INSTARGET)" "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>" + <%endif%> <%endif%> clean: @@ -171,10 +166,10 @@ realclean: clean #---------------------------------------------------------------------------- $(DEPENDENCIES): - touch $(DEPENDENCIES) + @touch $(DEPENDENCIES) depend: - <%depgen("depgen.pl")%> -t gnu $(CFLAGS) $(CCFLAGS) $(CPPFLAGS) -f $(DEPENDENCIES)<%foreach(source_files)%> <%source_file%><%endfor%> + <%depgen("makedepend -Y")%> $(CFLAGS) $(CCFLAGS) $(CPPFLAGS) -f $(DEPENDENCIES) $(SRC) 2> /dev/null include $(DEPENDENCIES) <%marker(bottom)%> diff --git a/templates/makedll.mpt b/templates/makedll.mpt index b3e1519c..1064e7e6 100644 --- a/templates/makedll.mpt +++ b/templates/makedll.mpt @@ -5,6 +5,18 @@ configurations = gcc soext = so cppflags = -O +// *********************************************************************** +// Configuration Section +// *********************************************************************** + +cxx { + cxx = cxx + clean = cxx_repository so_locations + tempincopt = "-ptr " + tempinc = cxx_repository + platforms = tru64 +} + gcc { cxx = g++ pic = -fPIC @@ -38,6 +50,16 @@ SGICC { platforms = irix } +// *********************************************************************** +// Platform Section +// *********************************************************************** + +tru64 { + extraflags = -D__USE_STD_IOSTREAM + shflags = -shared /usr/lib/libcxxstd.a + ldlibs = -ltli -lrt +} + linux { shflags = -shared ldlibs = -ldl -lpthread @@ -55,7 +77,7 @@ hpux { } aix { - soext = a + soext = ldlibs = -ldl } @@ -63,3 +85,25 @@ irix { shflags = -shared ldlibs = -lsocket -ldl -lnsl -lgen -lpthread } + +lynxos { + soext = +} + +macos { + dld = libtool + soext = dylib + shflags = -dynamic + ldlibs = -lcc_dynamic -lstdc++ -lSystem -ldl +} + +unixware { + shflags = -G + ldlibs = -lsocket -ldl -lnsl -lgen -lposix4 +} + +qnx { + shflags = -shared + ldlibs = -lsocket + extraflags = -D__GCC_BUILTIN +} diff --git a/templates/nmake.mpd b/templates/nmake.mpd index 0b1463a3..f8883056 100644 --- a/templates/nmake.mpd +++ b/templates/nmake.mpd @@ -164,12 +164,14 @@ LINK32_OBJS= \ <%foreach(resource_files)%> "$(INTDIR)\<%basenoextension(resource_file)%>.res" \ <%endfor%> +<%if(exename || sharedname || staticname)%> <%if(pch_source)%> "$(INTDIR)\<%basenoextension(pch_source)%>.obj" \ <%endif%> <%foreach(source_files)%> "$(INTDIR)\<%basenoextension(source_file)%>.obj"<%fornotlast(" \\")%> <%endfor%> +<%endif%> "<%if(type_is_dynamic)%><%if(dllout)%><%dllout%><%else%><%libout%><%endif%>\<%sharedname%><%lib_modifier%>.dll<%endif%><%if(type_is_static)%>$(OUTDIR)\<%staticname%><%lib_modifier%>.lib<%endif%><%if(exename)%>$(INSTALLDIR)\<%exename%>.exe<%endif%>" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< @@ -212,6 +214,7 @@ CPP_SWITCHES=/nologo <%if(add_compile)%><%add_compile%> <%endif%><%if(optimize)% <%endif%> <%endif%> +<%if(exename || sharedname || staticname)%> <%foreach(source_files)%> SOURCE=.\<%source_file%> @@ -221,6 +224,7 @@ SOURCE=.\<%source_file%> <%endif%> <%endfor%> +<%endif%> <%foreach(template_files)%> SOURCE=.\<%template_file%> <%endfor%> diff --git a/templates/vc6.mpd b/templates/vc6.mpd index 8cd762d4..96620b5c 100644 --- a/templates/vc6.mpd +++ b/templates/vc6.mpd @@ -79,6 +79,7 @@ LIB32=link.exe -lib <%foreach(configurations)%> # Name "<%project_name%> - <%platform%> <%configuration%>" <%endfor%> +<%if(exename || sharedname || staticname)%> # Begin Group "Source Files" # PROP Default_Filter "cpp;cxx;c" @@ -98,6 +99,7 @@ SOURCE=".\<%source_file%>" # End Source File <%endfor%> # End Group +<%endif%> <%if(header_files)%> # Begin Group "Header Files" diff --git a/templates/vc6dsp.mpd b/templates/vc6dsp.mpd index 8cd762d4..96620b5c 100644 --- a/templates/vc6dsp.mpd +++ b/templates/vc6dsp.mpd @@ -79,6 +79,7 @@ LIB32=link.exe -lib <%foreach(configurations)%> # Name "<%project_name%> - <%platform%> <%configuration%>" <%endfor%> +<%if(exename || sharedname || staticname)%> # Begin Group "Source Files" # PROP Default_Filter "cpp;cxx;c" @@ -98,6 +99,7 @@ SOURCE=".\<%source_file%>" # End Source File <%endfor%> # End Group +<%endif%> <%if(header_files)%> # Begin Group "Header Files" diff --git a/templates/vc7.mpd b/templates/vc7.mpd index 845241e0..4d3eae5a 100644 --- a/templates/vc7.mpd +++ b/templates/vc7.mpd @@ -61,7 +61,9 @@ <%if(type_is_binary)%> AdditionalDependencies="<%foreach(lit_libs)%><%lit_lib%>.lib <%endfor%><%foreach(libs defaultlibs)%><%lib%><%lib_modifier%>.lib<%fornotlast(" ")%><%endfor%>" <%endif%> +<%if(exename || sharedname || staticname)%> OutputFile="$(OutDir)/<%if(type_is_dynamic)%><%sharedname%><%lib_modifier%>.dll<%else%><%if(type_is_static)%><%staticname%><%lib_modifier%>.lib<%else%><%exename%>.exe<%endif%><%endif%>" +<%endif%> Version="<%version("1.0")%>" LinkIncremental="<%LinkIncremental("1")%>" SuppressStartupBanner="TRUE" @@ -104,6 +106,7 @@ <%endfor%> </Configurations> <Files> +<%if(exename || sharedname || staticname)%> <%if(source_files)%> <Filter Name="Source Files" @@ -128,6 +131,7 @@ <%endfor%> </Filter> <%endif%> +<%endif%> <%if(header_files)%> <Filter Name="Header Files" |