xref: /src/contrib/ncurses/include/Makefile.in (revision 68ad2b0d7af2a3571c4abac9afa712f9b09b721c)
1# $Id: Makefile.in,v 1.56 2025/10/18 13:33:46 tom Exp $
2##############################################################################
3# Copyright 2019-2024,2025 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		= @SHELL@
44VPATH		= @srcdir@
45THIS		= Makefile
46
47@SET_DESTDIR@
48srcdir		= @srcdir@
49prefix		= @prefix@
50exec_prefix	= @exec_prefix@
51includedir	= @includedir@
52includesubdir	= @includesubdir@
53
54INCLUDEDIR	= $(DESTDIR)$(includedir@MERGE_PREFIX@)$(includesubdir)
55
56INSTALL		= @INSTALL@
57INSTALL_DATA	= @INSTALL_DATA@
58
59AWK		= @AWK@
60LN_S		= @LN_S@
61
62CC		= @CC@
63CFLAGS		= @CFLAGS@ @EXTRA_CFLAGS@
64CPPFLAGS	= -DHAVE_CONFIG_H -I. @CPPFLAGS@
65
66CTAGS		= @CTAGS@
67ETAGS		= @ETAGS@
68
69VERSION		= @cf_cv_rel_version@
70
71# The "Caps" file specifies the terminfo database format, as well as the list
72# of function keys.
73TERMINFO_CAPS	= $(srcdir)/@TERMINFO_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	nc_win32.h \
82	ncurses_dll.h \
83	termcap.h \
84	unctrl.h
85
86# These files are generated by this makefile
87AUTO_SRC = \
88	curses.h \
89	hashsize.h \
90	ncurses_def.h \
91	parametrized.h \
92	config.h \
93	term.h
94
95################################################################################
96
97@MAKE_PHONY@.PHONY :	all
98@MAKE_PHONY@.PHONY :	check
99@MAKE_PHONY@.PHONY :	clean
100@MAKE_PHONY@.PHONY :	depend
101@MAKE_PHONY@.PHONY :	distclean
102@MAKE_PHONY@.PHONY :	install
103@MAKE_PHONY@.PHONY :	install.libs
104@MAKE_PHONY@.PHONY :	libs
105@MAKE_PHONY@.PHONY :	mostlyclean
106@MAKE_PHONY@.PHONY :	realclean
107@MAKE_PHONY@.PHONY :	sources
108@MAKE_PHONY@.PHONY :	uninstall
109@MAKE_PHONY@.PHONY :	uninstall.libs
110
111all \
112libs \
113depend \
114sources \
115install ::	$(AUTO_SRC)
116
117curses.h :	$(CAPLIST) \
118		curses.head \
119		$(srcdir)/curses.tail \
120		$(srcdir)/MKkey_defs.sh
121	cat curses.head >$@
122	AWK=$(AWK) $(SHELL) $(srcdir)/MKkey_defs.sh $(CAPLIST) >>$@
123	$(SHELL) -c 'if test "@NCURSES_WGETCH_EVENTS@" = "1" ; then cat $(srcdir)/curses.events >>$@ ; fi'
124	$(SHELL) -c 'if test "@NCURSES_CH_T@" = "cchar_t" ; then cat $(srcdir)/curses.wide >>$@ ; fi'
125	cat $(srcdir)/curses.tail >>$@
126
127term.h: 	$(CAPLIST) \
128		MKterm.h.awk
129	$(AWK) -f MKterm.h.awk $(CAPLIST) > $@
130	$(SHELL) $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@
131
132hashsize.h:	$(CAPLIST) \
133		$(srcdir)/MKhashsize.sh
134	$(SHELL) $(srcdir)/MKhashsize.sh $(CAPLIST) >$@
135
136ncurses_def.h: $(srcdir)/ncurses_defs $(srcdir)/MKncurses_def.sh
137	AWK=$(AWK) $(SHELL) $(srcdir)/MKncurses_def.sh $(srcdir)/ncurses_defs >$@
138
139parametrized.h: $(CAPLIST) \
140		$(srcdir)/MKparametrized.sh
141	AWK=$(AWK) $(SHELL) $(srcdir)/MKparametrized.sh $(CAPLIST) >$@
142
143# This is required by pthread.h on MinGW
144config.h:
145	touch $@
146
147tags:
148	$(CTAGS) *.[ch]
149
150@MAKE_UPPER_TAGS@TAGS:
151@MAKE_UPPER_TAGS@	$(ETAGS) *.[ch]
152
153mostlyclean ::
154	-rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
155
156clean :: mostlyclean
157	-rm -f $(AUTO_SRC)
158	-rm -rf *.dSYM
159
160distclean :: clean
161	-rm -f Makefile $(CONFIG_SRC) config.h
162
163realclean :: distclean
164
165# Verify that each header-file can be compiled without including another.
166check:
167	@$(SHELL) -c "for header in *.h;\
168		do \
169			echo \"** testing \$${header}\" ; \
170			echo \"#include <\$${header}>\" >headers.c; \
171			echo \"int main(void) { return 0; }\" >>headers.c; \
172			$(CC) -c $(CFLAGS) $(CPPFLAGS) headers.c; \
173		done"
174	-@rm -f headers.*
175
176###############################################################################
177# The remainder of this file is automatically generated during configuration
178###############################################################################
179