forked from flapjack321/lib-libargp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.uk
102 lines (92 loc) · 4.87 KB
/
Makefile.uk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# SPDX-License-Identifier: BSD-3-Clause
#
# libargp is a portable library providing the command-line parsing functionality of the argp module of the GNU Portability Library (Gnulib).
#
# Authors: Ethan Cotterell <[email protected]>
#
# Copyright (c) 2021, Lancaster University. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
################################################################################
# Library registration
################################################################################
$(eval $(call addlib_s,libargp,$(CONFIG_LIBARGP)))
################################################################################
# Sources
################################################################################]
LIBARGP_VERSION = 73fa3a226fa1a82ac9d8af20cb4dbb7a2f9cdbe7
LIBARGP_URL = https://github.com/alexreg/libargp/archive/$(LIBARGP_VERSION).zip
LIBARGP_SUBDIR = libargp-$(LIBARGP_VERSION)
LIBARGP_PATCHDIR = $(LIBARGP_BASE)/patches
$(eval $(call patch,libargp,$(LIBARGP_PATCHDIR),$(LIBARGP_SUBDIR)))
$(eval $(call fetch,libargp,$(LIBARGP_URL)))
################################################################################
# Helpers
################################################################################
LIBARGP_EXTRACTED = $(LIBARGP_ORIGIN)/libargp-$(LIBARGP_VERSION)
LIBARGP_SRC = $(LIBARGP_ORIGIN)/$(LIBARGP_SUBDIR)/gnulib/gllib
################################################################################
# Library includes
################################################################################
LIBARGP_CINCLUDES += -I$(LIBARGP_BASE)/include-internal
# CINCLUDES-y += -I$(LIBARGP_BASE)/include
CINCLUDES-y += -I$(LIBARGP_BASE)/include
################################################################################
# Flags
################################################################################
LIBARGP_FLAGS = -D _LIBC
# Suppress some warnings to make the build process look neater
LIBARGP_FLAGS_SUPPRESS = -Wunused-parameter -Wcomment -Wunused-parameter
LIBARGP_CFLAGS-y += $(LIBARGP_FLAGS)
LIBARGP_CFLAGS-y += $(LIBARGP_FLAGS_SUPPRESS)
################################################################################
# Glue code
################################################################################
# Include paths
# LIBARGP_CINCLUDES-y += $(LIBARGP_COMMON_INCLUDES-y)
# LIBARGP_CXXINCLUDES-y += $(LIBARGP_COMMON_INCLUDES-y)
LIBARGPSRCS-$(CONFIG_LIBARGP_MAIN_FUNCTION) += $(LIBARGP_BASE)/main.c|unikraft
################################################################################
# Library sources
################################################################################
LIBARGP_SRCS-y += $(LIBARGP_BASE)/progname.c
LIBARGP_SRCS-y += $(LIBARGP_SRC)/basename-lgpl.c
LIBARGP_SRCS-y += $(LIBARGP_SRC)/dirname-lgpl.c
LIBARGP_SRCS-y += $(LIBARGP_SRC)/getopt.c
LIBARGP_SRCS-y += $(LIBARGP_SRC)/getopt1.c
LIBARGP_SRCS-y += $(LIBARGP_BASE)/version-etc-fsf.c
LIBARGP_SRCS-y += $(LIBARGP_BASE)/version-etc.c
LIBARGP_SRCS-y += $(LIBARGP_SRC)/argp-ba.c
LIBARGP_SRCS-y += $(LIBARGP_SRC)/argp-eexst.c
LIBARGP_SRCS-y += $(LIBARGP_SRC)/argp-fmtstream.c
LIBARGP_SRCS-y += $(LIBARGP_SRC)/argp-fs-xinl.c
LIBARGP_SRCS-y += $(LIBARGP_SRC)/argp-help.c
LIBARGP_SRCS-y += $(LIBARGP_SRC)/argp-parse.c
LIBARGP_SRCS-y += $(LIBARGP_SRC)/argp-pin.c
LIBARGP_SRCS-y += $(LIBARGP_SRC)/argp-pv.c
LIBARGP_SRCS-y += $(LIBARGP_SRC)/argp-pvh.c
LIBARGP_SRCS-y += $(LIBARGP_BASE)/argp-version-etc.c
LIBARGP_SRCS-y += $(LIBARGP_SRC)/argp-xinl.c