Skip to content

Commit

Permalink
Install the libraries on mono/X.0 instead of mono/fsharp-X.0 to make …
Browse files Browse the repository at this point in the history
…it easier

to integrate with xbuild. Also, install the .targets file and adjust the paths
  • Loading branch information
Andreia Gaita committed Jan 4, 2011
1 parent 0984e93 commit 2fe7068
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
12 changes: 4 additions & 8 deletions src/fsharp/FSharp.Build/Microsoft.FSharp.targets
Expand Up @@ -17,16 +17,12 @@ Copyright (C) Microsoft Corporation. All rights reserved.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<UsingTask TaskName="Fsc" AssemblyFile="FSharp.Build{BuildSuffix}.dll"/>
<UsingTask TaskName="CreateFSharpManifestResourceName" AssemblyFile="FSharp.Build{BuildSuffix}.dll"/>
<UsingTask TaskName="Fsc" AssemblyFile="FSharp.Build.dll"/>
<UsingTask TaskName="CreateFSharpManifestResourceName" AssemblyFile="FSharp.Build.dll"/>


<PropertyGroup>
<!-- FSharpTargetsDir is the directory where the targets file lives -->
<FSharpTargetsDir Condition="'$(FSharpTargetsDir)'==''">$(MSBuildExtensionsPath32)\FSharp\1.0\</FSharpTargetsDir>
<!-- FSharpTargetsFullPath is the full path (dir + filename) of the targets file -->
<FSharpTargetsFullPath Condition="'$(FSharpTargetsDir)'!=''">$(FSharpTargetsDir)\Microsoft.FSharp{BuildSuffix}.targets</FSharpTargetsFullPath>
<MSBuildAllProjects>$(MSBuildAllProjects);$(FSharpTargetsFullPath)</MSBuildAllProjects>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildToolsPath)\Microsoft.FSharp.targets</MSBuildAllProjects>
<DefaultLanguageSourceExtension>.fs</DefaultLanguageSourceExtension>
<Language>F#</Language>
<Tailcalls Condition="'$(Tailcalls)'==''">$(Optimize)</Tailcalls>
Expand Down Expand Up @@ -188,6 +184,6 @@ Copyright (C) Microsoft Corporation. All rights reserved.

</Target>

<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets"/>
<Import Project="Microsoft.Common.targets"/>

</Project>
18 changes: 13 additions & 5 deletions src/fsharp/targets.make
Expand Up @@ -47,6 +47,9 @@ do-2-0: $(objdir) $(objdir)$(TARGET_2_0) $(objdir)$(TARGET_4_0) $(objdir)$(TARGE
@if test "x$(SIGN)" = "x1"; \
then sn -R $(outdir)$(ASSEMBLY) $(srcdir)../../../mono.snk; \
fi
@if test -e Microsoft.FSharp.targets; then \
cp Microsoft.FSharp.targets $(outdir); \
fi

do-4-0: DEFINES += $(DEFINES_4_0)
do-4-0: REFERENCES += $(REFERENCES_4_0)
Expand All @@ -68,6 +71,9 @@ do-4-0: $(objdir) $(objdir)$(TARGET_2_0) $(objdir)$(TARGET_4_0) $(objdir)$(TARGE
@if test "x$(SIGN)" = "x1"; \
then sn -R $(outdir)$(ASSEMBLY) $(srcdir)../../../mono.snk; \
fi
@if test -e Microsoft.FSharp.targets; then \
cp Microsoft.FSharp.targets $(outdir); \
fi

install-lib-2: TARGET := $(TARGET_2_0)
install-lib-2: VERSION := $(VERSION_2_0)
Expand All @@ -82,22 +88,24 @@ install-bin-4: TARGET := $(TARGET_4_0)
install-lib-2 install-lib-4:
@echo "Installing $(ASSEMBLY)"
@mkdir -p $(DESTDIR)/$(libdir)
@gacutil -i $(outdir)$(ASSEMBLY) -root $(DESTDIR)/$(libdir) -package fsharp-$(TARGET)
@mkdir -p $(DESTDIR)/$(libdir)mono/$(TARGET)
@gacutil -i $(outdir)$(ASSEMBLY) -root $(DESTDIR)/$(libdir) -package $(TARGET)
@if test -e $(outdir)$(NAME).sigdata; then \
$(INSTALL_LIB) $(outdir)$(NAME).sigdata $(DESTDIR)/$(libdir)mono/gac/$(NAME)/$(VERSION)__$(TOKEN); \
ln -s $(DESTDIR)/$(libdir)mono/gac/$(NAME)/$(VERSION)__$(TOKEN)/$(NAME).sigdata $(DESTDIR)/$(libdir)mono/fsharp-$(TARGET)/$(NAME).sigdata; \
ln -fs $(DESTDIR)/$(libdir)mono/gac/$(NAME)/$(VERSION)__$(TOKEN)/$(NAME).sigdata $(DESTDIR)/$(libdir)mono/$(TARGET)/$(NAME).sigdata; \
fi
@if test -e $(outdir)$(NAME).optdata; then \
$(INSTALL_LIB) $(outdir)$(NAME).optdata $(DESTDIR)/$(libdir)mono/gac/$(NAME)/$(VERSION)__$(TOKEN); \
ln -s $(DESTDIR)/$(libdir)mono/gac/$(NAME)/$(VERSION)__$(TOKEN)/$(NAME).optdata $(DESTDIR)/$(libdir)mono/fsharp-$(TARGET)/$(NAME).optdata; \
ln -fs $(DESTDIR)/$(libdir)mono/gac/$(NAME)/$(VERSION)__$(TOKEN)/$(NAME).optdata $(DESTDIR)/$(libdir)mono/$(TARGET)/$(NAME).optdata; \
fi
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.targets $(DESTDIR)/$(libdir)mono/$(TARGET)/;

install-bin-2 install-bin-4:
sed -e 's,[@]DIR[@],$(libdir)mono/fsharp-$(TARGET),g' -e 's,[@]TOOL[@],fsc.exe,g' < $(topdir)launcher.in > $(outdir)$(NAME)$(VERSION)
sed -e 's,[@]DIR[@],$(libdir)mono/$(TARGET),g' -e 's,[@]TOOL[@],fsc.exe,g' < $(topdir)launcher.in > $(outdir)$(NAME)$(VERSION)
chmod +x $(outdir)$(NAME)$(VERSION)
@mkdir -p $(DESTDIR)/$(libdir)
@mkdir -p $(DESTDIR)/$(bindir)
$(INSTALL_LIB) $(outdir)$(ASSEMBLY) $(DESTDIR)$(libdir)mono/fsharp-$(TARGET)
$(INSTALL_LIB) $(outdir)$(ASSEMBLY) $(DESTDIR)$(libdir)mono/$(TARGET)
$(INSTALL_BIN) $(outdir)$(NAME)$(VERSION) $(DESTDIR)/$(bindir)

$(objdir) $(objdir)$(TARGET_2_0) $(objdir)$(TARGET_4_0):
Expand Down

0 comments on commit 2fe7068

Please sign in to comment.