blob: c123e5cae5eb8580b3099b055893865cdcd89875 [file] [log] [blame]
LuK133752a81d52025-07-08 18:07:20 -04001# $Id: Makefile.in,v 1.53 2021/07/03 18:56:51 tom Exp $
2##############################################################################
3# Copyright 2019-2020,2021 Thomas E. Dickey #
4# Copyright 1998-2013,2015 Free Software Foundation, Inc. #
5# #
6# Permission is hereby granted, free of charge, to any person obtaining a #
7# copy of this software and associated documentation files (the "Software"), #
8# to deal in the Software without restriction, including without limitation #
9# the rights to use, copy, modify, merge, publish, distribute, distribute #
10# with modifications, sublicense, and/or sell copies of the Software, and to #
11# permit persons to whom the Software is furnished to do so, subject to the #
12# following conditions: #
13# #
14# The above copyright notice and this permission notice shall be included in #
15# all copies or substantial portions of the Software. #
16# #
17# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
18# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
19# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
20# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
21# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
22# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
23# DEALINGS IN THE SOFTWARE. #
24# #
25# Except as contained in this notice, the name(s) of the above copyright #
26# holders shall not be used in advertising or otherwise to promote the sale, #
27# use or other dealings in this Software without prior written #
28# authorization. #
29##############################################################################
30#
31# Author: Thomas E. Dickey 1996-on
32#
33# Makefile for ncurses source code.
34#
35# This makes/installs ncurses include-files
36#
37# The variable 'srcdir' refers to the source-distribution, and can be set with
38# the configure script by "--srcdir=DIR".
39
40# turn off _all_ suffix rules; we'll generate our own
41.SUFFIXES:
42
43SHELL = /bin/sh
44
45THIS = Makefile
46
47DESTDIR =
48srcdir = .
49prefix = /usr
50exec_prefix = ${prefix}
51includedir = ${prefix}/include
52includesubdir =
53
54INCLUDEDIR = $(DESTDIR)$(includedir)$(includesubdir)
55
56INSTALL = /usr/bin/install -c
57INSTALL_DATA = ${INSTALL} -m 644
58
59AWK = mawk
60LN_S = ln -s -f
61
62CC = gcc
63CFLAGS = -O2 --param max-inline-insns-single=1200
64CPPFLAGS = -DHAVE_CONFIG_H -I. -I. -I../include -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DNDEBUG
65
66CTAGS = ctags
67ETAGS = etags
68
69VERSION = 6.5
70
71# The "Caps" file specifies the terminfo database format, as well as the list
72# of function keys.
73TERMINFO_CAPS = $(srcdir)/Caps
74CAPLIST = $(TERMINFO_CAPS) \
75 $(srcdir)/Caps-ncurses
76
77# These files are generated by the configure script
78CONFIG_SRC = \
79 MKterm.h.awk \
80 curses.head \
81 ncurses_dll.h \
82 termcap.h \
83 unctrl.h
84
85# These files are generated by this makefile
86AUTO_SRC = \
87 curses.h \
88 hashsize.h \
89 ncurses_def.h \
90 parametrized.h \
91 config.h \
92 term.h
93
94################################################################################
95
96.PHONY : all
97.PHONY : check
98.PHONY : clean
99.PHONY : depend
100.PHONY : distclean
101.PHONY : install
102.PHONY : install.libs
103.PHONY : libs
104.PHONY : mostlyclean
105.PHONY : realclean
106.PHONY : sources
107.PHONY : uninstall
108.PHONY : uninstall.libs
109
110all \
111libs \
112depend \
113sources \
114install :: $(AUTO_SRC)
115
116curses.h : $(CAPLIST) \
117 curses.head \
118 $(srcdir)/curses.tail \
119 $(srcdir)/MKkey_defs.sh
120 cat curses.head >$@
121 AWK=$(AWK) $(SHELL) $(srcdir)/MKkey_defs.sh $(CAPLIST) >>$@
122 $(SHELL) -c 'if test "0" = "1" ; then cat $(srcdir)/curses.events >>$@ ; fi'
123 $(SHELL) -c 'if test "cchar_t" = "cchar_t" ; then cat $(srcdir)/curses.wide >>$@ ; fi'
124 cat $(srcdir)/curses.tail >>$@
125
126term.h: $(CAPLIST) \
127 MKterm.h.awk
128 $(AWK) -f MKterm.h.awk $(CAPLIST) > $@
129 $(SHELL) $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@
130
131hashsize.h: $(CAPLIST) \
132 $(srcdir)/MKhashsize.sh
133 $(SHELL) $(srcdir)/MKhashsize.sh $(CAPLIST) >$@
134
135ncurses_def.h: $(srcdir)/ncurses_defs $(srcdir)/MKncurses_def.sh
136 AWK=$(AWK) $(SHELL) $(srcdir)/MKncurses_def.sh $(srcdir)/ncurses_defs >$@
137
138parametrized.h: $(CAPLIST) \
139 $(srcdir)/MKparametrized.sh
140 AWK=$(AWK) $(SHELL) $(srcdir)/MKparametrized.sh $(CAPLIST) >$@
141
142# This is required by pthread.h on MinGW
143config.h:
144 touch $@
145
146tags:
147 $(CTAGS) *.[ch]
148
149TAGS:
150 $(ETAGS) *.[ch]
151
152mostlyclean ::
153 -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
154
155clean :: mostlyclean
156 -rm -f $(AUTO_SRC)
157 -rm -rf *.dSYM
158
159distclean :: clean
160 -rm -f Makefile $(CONFIG_SRC) config.h
161
162realclean :: distclean
163
164# Verify that each header-file can be compiled without including another.
165check:
166 @$(SHELL) -c "for header in *.h;\
167 do \
168 echo \"** testing \$${header}\" ; \
169 echo \"#include <\$${header}>\" >headers.c; \
170 echo \"int main(void) { return 0; }\" >>headers.c; \
171 $(CC) -c $(CFLAGS) $(CPPFLAGS) headers.c; \
172 done"
173 -@rm -f headers.*
174
175###############################################################################
176# The remainder of this file is automatically generated during configuration
177###############################################################################
178
179# generated by mk-hdr.awk
180# subset: ticlib+termlib+ext_tinfo+base+widechar+ext_funcs
181# compat: yes
182
183${INCLUDEDIR} :
184 mkdir -p $@
185
186install \
187install.libs \
188install.includes :: ${AUTO_SRC} ${INCLUDEDIR} \
189 curses.h \
190 unctrl.h \
191 ncurses_dll.h \
192 term.h \
193 termcap.h \
194 $(srcdir)/term_entry.h
195 @ (cd ${INCLUDEDIR} && rm -f curses.h) ; ../headers.sh ${INSTALL_DATA} ${INCLUDEDIR} ${srcdir} curses.h
196 @ (cd ${INCLUDEDIR} && rm -f ncurses.h && ${LN_S} curses.h ncurses.h)
197 @ (cd ${INCLUDEDIR} && rm -f unctrl.h) ; ../headers.sh ${INSTALL_DATA} ${INCLUDEDIR} ${srcdir} unctrl.h
198 @ (cd ${INCLUDEDIR} && rm -f ncurses_dll.h) ; ../headers.sh ${INSTALL_DATA} ${INCLUDEDIR} ${srcdir} ncurses_dll.h
199 @ (cd ${INCLUDEDIR} && rm -f term.h) ; ../headers.sh ${INSTALL_DATA} ${INCLUDEDIR} ${srcdir} term.h
200 @ (cd ${INCLUDEDIR} && rm -f termcap.h) ; ../headers.sh ${INSTALL_DATA} ${INCLUDEDIR} ${srcdir} termcap.h
201 @ (cd ${INCLUDEDIR} && rm -f term_entry.h) ; ../headers.sh ${INSTALL_DATA} ${INCLUDEDIR} ${srcdir} $(srcdir)/term_entry.h
202
203uninstall \
204uninstall.libs \
205uninstall.includes ::
206 -@ (cd ${INCLUDEDIR} && rm -f curses.h)
207 -@ (cd ${INCLUDEDIR} && rm -f ncurses.h)
208 -@ (cd ${INCLUDEDIR} && rm -f unctrl.h)
209 -@ (cd ${INCLUDEDIR} && rm -f ncurses_dll.h)
210 -@ (cd ${INCLUDEDIR} && rm -f term.h)
211 -@ (cd ${INCLUDEDIR} && rm -f termcap.h)
212 -@ (cd ${INCLUDEDIR} && rm -f term_entry.h)