blob: 092d13b3d6081903ccf3c7fbfbc232a62138e4a9 [file] [log] [blame]
Igor Sarkisovfc43e552020-10-01 13:59:27 -07001#
2# Copyright (c) 2010-2011 Nest, Inc.
3# All rights reserved.
4#
5# This document is the property of Nest. It is considered
6# confidential and proprietary information.
7#
8# This document may not be reproduced or transmitted in any form,
9# in whole or in part, without the express written permission of
10# Nest.
11#
12# Description:
13# This file is the makefile for the POSIX.1e superuser
14# capabilities detection library.
15#
16
17BuildConfigSpecialized := No
18BuildProductSpecialized := No
19
20include pre.mak
21
22PackageName := libcap
23
24PackageExtension := tar.gz
25PackageSeparator := -
26
27PackagePatchArgs := -p1
28
29PackageArchive := $(PackageName).$(PackageExtension)
30PackageSourceDir := $(PackageName)$(PackageSeparator)$(PackageVersion)
31
32PackageBuildMakefile = $(call GenerateBuildPaths,Makefile)
33
34CleanPaths += $(PackageLicenseFile)
35
36LinuxHeaderDir := $(call GenerateResultPaths,sw/tps/linux,include)
37
38all: $(PackageDefaultGoal)
39
40# Generate the package license contents.
41
42$(PackageSourceDir)/License: source
43
44$(PackageLicenseFile): $(PackageSourceDir)/License
45 $(copy-result)
46
47# Extract the source from the archive and apply patches, if any.
48
49$(PackageSourceDir): $(PackageArchive) $(PackagePatchPaths)
50 $(expand-and-patch-package)
51
52# Prepare the sources.
53
54.PHONY: source
55source: | $(PackageSourceDir)
56
57# Patch the sources, if necessary.
58
59.PHONY: patch
60patch: source
61
62# Generate the package build makefile.
63
64$(PackageBuildMakefile): | $(PackageSourceDir) $(BuildDirectory)
65 $(call create-links,$(CURDIR)/$(PackageSourceDir),$(BuildDirectory))
66
67# Configure the source for building.
68
69.PHONY: configure
70configure: source $(PackageBuildMakefile)
71
72# Build the source.
73#
74# We have to unset MAKEFLAGS since they confuse the package build otherwise.
75
76.PHONY: build
77build: configure | $(BuildDirectory)
78 $(Verbose)unset MAKEFLAGS && \
79 $(MAKE) -C $(BuildDirectory) \
80 BUILD_CC=gcc \
81 CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) STRIP=$(STRIP) \
82 LIBATTR=no \
83 KERNEL_HEADERS=$(LinuxHeaderDir) \
84 all
85
86# Stage the build to a temporary installation area.
87#
88# We have to unset MAKEFLAGS since they confuse the package build otherwise.
89
90.PHONY: stage
91stage: build | $(ResultDirectory)
92 $(Verbose)unset MAKEFLAGS && \
93 $(MAKE) -C $(BuildDirectory) \
94 BUILD_CC=gcc \
95 CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) STRIP=$(STRIP) \
96 LIBATTR=no \
97 FAKEROOT=$(ResultDirectory) \
98 KERNEL_HEADERS=$(LinuxHeaderDir) \
99 install
100
101clean:
102 $(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir)
103 $(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
104 $(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory)
105
106include post.mak