Project import
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f3c32d9
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,101 @@
+#
+# Copyright (c) 2017 Nest, Inc.
+# All rights reserved.
+#
+# This document is the property of Nest. It is considered
+# confidential and proprietary information.
+#
+# This document may not be reproduced or transmitted in any form,
+# in whole or in part, without the express written permission of
+# Nest.
+#
+# Description:
+# This Makefile is used to build libfuse, the reference implementation of
+# the Linux FUSE (Filesystem in Userspace) interface.
+#
+include pre.mak
+
+PackageName := libfuse
+
+PackageSourceDir := $(BuildRoot)/paths/libfuse
+
+PackageBuildMakefile = $(call GenerateBuildPaths,Makefile)
+
+LicenseSourceFile = $(PackageSourceDir)/COPYING.LIB
+
+CleanPaths += $(PackageLicenseFile)
+
+SOURCEDIRS = $(PackageSourceDir)
+$(PackageSourceDir)_RULE_TARGET = $(BuildDirectory)/build
+
+all: $(PackageDefaultGoal)
+
+# Generate the package license contents.
+
+$(LicenseSourceFile): $(BuildDirectory)/source
+
+$(PackageLicenseFile): $(LicenseSourceFile)
+ $(copy-result)
+
+# Prepare the sources.
+
+$(BuildDirectory)/source: | $(PackageSourceDir) $(BuildDirectory)
+ $(Verbose)touch $@
+
+# Patch the sources, if necessary.
+
+$(BuildDirectory)/patch: $(BuildDirectory)/source
+ $(Verbose)touch $@
+
+# Generate configure script
+
+$(BuildDirectory)/autoconf: $(BuildDirectory)/source
+ $(Verbose)cd $(PackageSourceDir) && \
+ ./makeconf.sh
+ $(Verbose)touch $@
+
+# Configure the source for building.
+
+$(BuildDirectory)/configure: $(BuildDirectory)/source $(BuildDirectory)/autoconf| $(PackageSourceDir) $(BuildDirectory)
+ $(Verbose)cd $(BuildDirectory) && \
+ $(PackageSourceDir)/configure \
+ CC="$(CC) $(CPPOPTFLAGS)" CXX="$(CXX) $(CXXOPTFLAGS)" AR=$(AR) RANLIB=$(RANLIB) STRIP=$(STRIP) \
+ CPPFLAGS="$(call ToolGenerateIncludeArgument,$(LinuxIncludePath))" \
+ INSTALL="$(INSTALL) $(INSTALLFLAG)" \
+ --build=$(HostTuple) \
+ --host=$(TargetTuple) \
+ --prefix=$(addprefix $(LibPrefixConfigOption),/usr) \
+ --sysconfdir=$(addprefix $(LibPrefixConfigOption),/etc) \
+ --localstatedir=$(addprefix $(LibPrefixConfigOption),/var) \
+ --enable-static=no
+ $(Verbose)touch $@
+
+# Build the source.
+#
+# We have to unset MAKEFLAGS since they confuse the package build otherwise.
+
+$(BuildDirectory)/build: $(BuildDirectory)/configure | $(BuildDirectory)
+ $(Verbose)unset MAKEFLAGS && \
+ $(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
+ all
+ $(Verbose)touch $@
+
+# Stage the build to a temporary installation area.
+#
+# We have to unset MAKEFLAGS since they confuse the package build otherwise.
+
+$(BuildDirectory)/stage: $(BuildDirectory)/build | $(ResultDirectory)
+ $(Verbose)unset MAKEFLAGS && \
+ $(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
+ $(call GenerateLibraryDestinationArgument,$(ResultDirectory)) \
+ install
+ $(Verbose)touch $@
+
+.PHONY: stage
+stage: $(BuildDirectory)/stage
+
+clean:
+ $(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
+ $(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory)
+
+include post.mak