summaryrefslogtreecommitdiffstats
path: root/src/sed/Makefile.kmk
blob: f34b3e8ba82a8af712e3f16f1d04a121ef5751ab (plain)
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
103
104
105
106
107
108
109
110
111
112
# $Id: Makefile.kmk 3062 2017-09-30 11:26:21Z bird $
## @file
# Sub-Makefile for kmk_sed.
#

#
# Copyright (c) 2006-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
#
# This file is part of kBuild.
#
# kBuild is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# kBuild is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with kBuild.  If not, see <http://www.gnu.org/licenses/>
#
#

SUB_DEPTH = ../..
include $(KBUILD_PATH)/subheader.kmk

#
# kmk_sed
#
PROGRAMS += kmk_sed

kmk_sed_TEMPLATE = BIN
kmk_sed_DEPS = \
	$(kmk_sed_0_OUTDIR)/config.h \
	$(kmk_sed_0_OUTDIR)/regex.h
kmk_sed_CLEAN = $(kmk_sed_DEPS)
kmk_sed_CFLAGS.solaris = -std=gnu99
kmk_sed_INCS = \
	$(kmk_sed_0_OUTDIR) \
	. \
	lib \
	intl
kmk_sed_DEFS = \
	HAVE_CONFIG_H
ifdef KBUILD_SOLARIS_10
 kmk_sed_CFLAGS += -std=gnu99
endif
kmk_sed_SOURCES = \
	sed/sed.c \
	lib/regex.c \
	sed/compile.c \
	sed/execute.c \
	sed/regexp.c \
	sed/fmt.c \
	sed/mbcs.c \
	lib/getopt1.c \
	lib/getopt.c \
	lib/utils.c
kmk_sed_SOURCES.darwin = \
	lib/strverscmp.c \
	lib/obstack.c \
	lib/getline.c
kmk_sed_SOURCES.dragonfly = \
	lib/strverscmp.c \
	lib/obstack.c \
	lib/getline.c
kmk_sed_SOURCES.freebsd = \
	lib/strverscmp.c \
	lib/obstack.c \
	lib/getline.c
kmk_sed_SOURCES.haiku = \
	lib/strverscmp.c \
	lib/obstack.c
kmk_sed_SOURCES.netbsd = \
	lib/strverscmp.c \
	lib/obstack.c \
	lib/getline.c
kmk_sed_SOURCES.openbsd = \
	lib/strverscmp.c \
	lib/obstack.c \
	lib/getline.c
kmk_sed_SOURCES.solaris = \
	lib/strverscmp.c \
	lib/obstack.c \
	lib/getline.c
kmk_sed_SOURCES.win = \
	lib/strverscmp.c \
	lib/obstack.c \
	lib/mkstemp.c \
	lib/getline.c \
	../lib/startuphacks-win.c

kmk_sed_LIBS.win = $(LIB_KUTIL) # for stdout optimizations.

include $(FILE_KBUILD_SUB_FOOTER)

#
# Use checked in config.h instead of running ./configure for it.
#
kmk_sed_config.h.$(KBUILD_TARGET) := $(kmk_sed_DEFPATH)/config.h.$(KBUILD_TARGET)

$(kmk_sed_0_OUTDIR)/config.h: $(kmk_sed_config.h.$(KBUILD_TARGET)) | $(call DIRDEP,$(kmk_sed_0_OUTDIR))
	$(CP) -f $^ $@

#
# Use the regex lib shipped with sed and not anything installed on the system.
#
$(kmk_sed_0_OUTDIR)/regex.h: $(kmk_sed_DEFPATH)/lib/regex_.h | $(call DIRDEP,$(kmk_sed_0_OUTDIR))
	$(CP) -f $^ $@