xref: /illumos-gate/usr/src/lib/libcurses/Makefile.com (revision 3db86aab554edbb4244c8d1a1c90f152eee768af)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# lib/libcurses/screen/Makefile
29#
30LIBRARY=	libcurses.a
31VERS=	.1
32
33OBJECTS=	$(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) $(OBJS6)
34
35OBJS1=	_addch.o _addchnstr.o _addchstr.o _addnstr.o _addstr.o \
36	_attroff.o _attron.o _attrset.o _beep.o _bkgd.o \
37	_bkgdset.o _border.o _box.o _clear.o _clrtobot.o \
38	_clrtoeol.o _crmode.o _del_curterm.o _delch.o _deleteln.o \
39	_echo.o _echochar.o _erase.o _fixterm.o _flash.o \
40	_garbagdlins.o _garbagedwin.o _getch.o _getstr.o \
41	_halfdelay.o _hline.o _inch.o _inchnstr.o _inchstr.o \
42	_innstr.o _insch.o _insdelln.o _insertln.o _insnstr.o \
43	_insstr.o _instr.o _intrflush.o _meta.o _move.o \
44	_mvaddch.o _mvaddchnstr.o _mvaddchstr.o _mvaddnstr.o \
45	_mvaddstr.o _mvdelch.o _mvgetch.o _mvgetstr.o _mvhline.o \
46	_mvinch.o _mvinchnstr.o _mvinchstr.o _mvinnstr.o \
47	_mvinsch.o _mvinsnstr.o _mvinsstr.o _mvinstr.o _mvvline.o \
48	_mvwaddch.o _mvwaddchnst.o _mvwaddchstr.o _mvwaddnstr.o \
49	_mvwaddstr.o _mvwdelch.o _mvwgetch.o _mvwgetstr.o \
50	_mvwhline.o _mvwinch.o _mvwinchnst.o _mvwinchstr.o \
51	_mvwinnstr.o _mvwinsch.o _mvwinsnstr.o _mvwinsstr.o \
52	_mvwinstr.o _mvwvline.o _newterm.o _nl.o _nocrmode.o \
53	_noecho.o _nonl.o _noqiflush.o _overlay.o _overwrite.o \
54	_qiflush.o _refresh.o _resetterm.o _saveterm.o \
55	_scr_init.o _scr_restore.o _scr_set.o _scrl.o _scroll.o \
56	_set_curterm.o _set_term.o _setscrreg.o _slk_init.o \
57	_standend.o _standout.o _subpad.o _timeout.o _touchline.o \
58	_unctrl.o _vline.o _waddchstr.o _waddstr.o _wclear.o \
59	_wdeleteln.o _werase.o _winsertln.o _winsstr.o \
60	_wstandend.o _wstandout.o V2.__sscans.o V2._sprintw.o \
61	V2.makenew.o V3.box.o V3.initscr.o V3.m_addch.o V3.m_addstr.o \
62	V3.m_clear.o V3.m_erase.o V3.m_initscr.o V3.m_move.o V3.m_newterm.o \
63	V3.m_refresh.o V3.newterm.o V3.pechochar.o V3.upd_old_y.o \
64	V3.vidattr.o V3.vidputs.o V3.waddch.o V3.wattroff.o V3.wattron.o \
65	V3.wattrset.o V3.wechochar.o V3.winsch.o baudrate.o can_change.o \
66	color_cont.o cbreak.o chkinput.o clearok.o copywin.o curs_set.o \
67	curserr.o curses.o def_prog.o delay.o delay_out.o \
68	delkey.o delkeymap.o delscreen.o delterm.o delwin.o \
69	derwin.o doupdate.o draino.o dupwin.o endwin.o erasechar.o \
70	flushinp.o getattrs.o getbegyx.o getbkgd.o getmaxyx.o \
71	getparyx.o getsyx.o gettmode.o getwin.o getyx.o has_colors.o \
72	has_ic.o has_il.o idcok.o idlok.o immedok.o init_acs.o init_color.o \
73	init_costs.o init_pair.o initscr.o is_linetou.o is_wintou.o \
74	keyname.o keypad.o killchar.o leaveok.o
75
76OBJS2=	longname.o makenew.o memSset.o meta.o mvcur.o \
77	mvderwin.o mvprintw.o mvscanw.o mvwin.o mvwprintw.o \
78	mvwscanw.o napms.o newkey.o newpad.o newscreen.o \
79	newwin.o nocbreak.o nodelay.o noraw.o \
80	notimeout.o outch.o overlap.o pechochar.o pnoutref.o \
81	prefresh.o printw.o putp.o putwin.o quick_echo.o \
82	raw.o redrawwin.o reset_sh.o resetty.o restart.o \
83	ring.o ripoffline.o savetty.o scanw.o scr_all.o \
84	scr_dump.o scr_ll_dump.o scr_reset.o scrollok.o setcurscreen.o \
85	setcurterm.o setecho.o setkeymap.o setnonl.o setqiflush.o \
86	setsyx.o setterm.o setupterm.o slk_atroff.o slk_atron.o \
87	slk_atrset.o slk_clear.o slk_label.o \
88	slk_noutref.o slk_refresh.o slk_restore.o slk_set.o slk_start.o \
89	slk_touch.o subwin.o syncok.o tcsearch.o termattrs.o \
90	termcap.o termerr.o termname.o tgetch.o tgoto.o \
91	tifget.o tifnames.o tiget.o tinames.o tinputfd.o \
92	tnames.o touchwin.o tparm.o tputs.o trace.o \
93	tstp.o ttimeout.o typeahead.o unctrl.o ungetch.o \
94	untouchwin.o vidputs.o vidupdate.o vwprintw.o \
95	vwscanw.o waddch.o waddchnstr.o waddnstr.o wattroff.o \
96	wattron.o wattrset.o wbkgd.o wbkgdset.o wborder.o \
97	wclrtobot.o wclrtoeol.o wdelch.o wechochar.o wgetch.o \
98	wgetstr.o whline.o winch.o winchnstr.o winchstr.o \
99	winnstr.o winsch.o winsdelln.o winsnstr.o winstr.o \
100	wmove.o wnoutref.o wprintw.o wredrawln.o wrefresh.o \
101	wscanw.o wscrl.o wsetscrreg.o wsyncdown.o wsyncup.o \
102	wtimeout.o wtouchln.o wvline.o pair_cont.o start_col.o \
103	mouse.o
104
105OBJS3=	mbaddch.o mbcharlen.o mbdisplen.o mbgetwidth.o \
106	mbinch.o mbinsshift.o mbmove.o mbtranslate.o \
107	pechowchar.o tgetwch.o ungetwch.o waddnwstr.o \
108	waddwch.o waddwchnstr.o wechowchar.o wgetwstr.o \
109	wgetwch.o winnwstr.o winsnwstr.o winswch.o \
110	winwch.o winwchnstr.o winwstr.o \
111	use_env.o
112
113OBJS4=	_addnwstr.o _addwch.o _addwchnstr.o _addwchstr.o \
114	_addwstr.o _echowchar.o _getnwstr.o _getwch.o \
115	_getwstr.o _innwstr.o _insnwstr.o _inswch.o \
116	_inswstr.o _inwch.o _inwchnstr.o _inwchstr.o \
117	_inwstr.o _mvaddnwstr.o _mvaddwch.o _mvaddwchnstr.o \
118	_mvaddwchstr.o _mvaddwstr.o _mvgetnwstr.o _mvgetwch.o \
119	_mvgetwstr.o _mvinnwstr.o _mvinsnwstr.o _mvinswch.o \
120	_mvinswstr.o _mvinwch.o _mvinwchnstr.o _mvinwchstr.o \
121	_mvinwstr.o _mvwaddnwstr.o _mvwaddwch.o _mvwaddwchnstr.o \
122	_mvwaddwchstr.o _mvwaddwstr.o _mvwgetnwstr.o _mvwgetwch.o \
123	_mvwgetwstr.o _mvwinnwstr.o _mvwinsnwstr.o _mvwinswch.o \
124	_mvwinswstr.o _mvwinwch.o _mvwinwchnstr.o _mvwinwchstr.o \
125	_mvwinwstr.o _waddwchstr.o _waddwstr.o _winswstr.o \
126	_winwchstr.o
127
128OBJS5=	mbstowcs.o mbtowc.o wcstombs.o wctomb.o
129
130OBJS6=	wmovenextch.o wmoveprevch.o wadjcurspos.o print.o iexpand.o \
131	cexpand.o infotocap.o
132
133# include library definitions
134include ../../Makefile.lib
135
136# install this library in the root filesystem
137include ../../Makefile.rootfs
138
139MAPFILE=	$(MAPDIR)/mapfile
140MAPOPTS=	$(MAPFILE:%=-M %)
141
142SRCS=		$(OBJECTS:%.o=../screen/%.c)
143
144LIBS =		$(DYNLIB) $(LINTLIB)
145
146# definitions for lint
147
148$(LINTLIB):= SRCS=../screen/llib-lcurses
149
150LINTOUT=	lint.out
151LINTSRC=	$(LINTLIB:%.ln=%)
152
153ROOTLINTDIR=	$(ROOTLIBDIR)
154ROOTLINT=	$(LINTSRC:%=$(ROOTLINTDIR)/%)
155ROOTLINTDIR64=	$(ROOTLIBDIR64)
156ROOTLINT64=	$(LINTSRC:%=$(ROOTLINTDIR64)/%)
157ROOTLINKS64=	$(ROOTLIBDIR64)/$(LIBLINKS)
158
159CLEANFILES +=	$(LINTOUT) $(LINTLIB)
160
161CFLAGS	+=	$(CCVERBOSE)
162DYNFLAGS +=	$(MAPOPTS)
163LDLIBS += -lc
164
165CPPFLAGS += -I../screen -I../../common/inc
166
167ED = ed
168RM = rm -f
169
170#
171# If and when somebody gets around to messaging this, CLOBBERFILE should not
172# be cleared (so that any .po file will be clobbered.
173#
174CLOBBERFILES=	libcurses.so libcurses.so$(VERS)
175
176.KEEP_STATE:
177
178all: $(LIBS)
179
180lint: lintcheck
181
182$(DYNLIB): 	$(MAPFILE)
183
184$(MAPFILE):
185	@cd $(MAPDIR); $(MAKE) mapfile
186
187
188# install rule for 32-bit libcurses.a
189$(ROOTLIBDIR)/%.a: %.a
190	$(INS.file)
191		cd $(ROOTLIBDIR); \
192		$(RM) libtermlib.a libtermcap.a; \
193		ln libcurses.a libtermlib.a; \
194		ln libcurses.a libtermcap.a;
195
196# install rules for 32-bit libcurses.so in /usr/lib
197$(ROOTLINKS) := INS.liblink= \
198	$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKS)$(VERS) $@; \
199		cd $(ROOTLIBDIR); \
200		$(RM) libtermlib.so$(VERS) libtermcap.so$(VERS); \
201		$(RM) libtermlib.so libtermcap.so; \
202		$(SYMLINK) libcurses.so$(VERS) libtermlib.so$(VERS); \
203		$(SYMLINK) libcurses.so$(VERS) libtermcap.so$(VERS); \
204		$(SYMLINK) libtermlib.so$(VERS) libtermlib.so; \
205		$(SYMLINK) libtermcap.so$(VERS) libtermcap.so;
206
207#
208# Include library targets
209#
210include ../../Makefile.targ
211
212pics/%.o: ../screen/%.c
213	$(COMPILE.c) -o $@ $<
214	$(POST_PROCESS_O)
215
216# install rule for lint library target
217$(ROOTLINTDIR)/%: ../screen/%
218	$(INS.file)
219	cd $(ROOTLINTDIR); \
220		$(RM) llib-ltermcap llib-ltermlib ; \
221		$(SYMLINK) ./llib-lcurses llib-ltermcap; \
222		$(SYMLINK) ./llib-lcurses llib-ltermlib; \
223		$(RM) llib-ltermcap.ln llib-ltermlib.ln ; \
224		$(SYMLINK) ./llib-lcurses.ln llib-ltermcap.ln; \
225		$(SYMLINK) ./llib-lcurses.ln llib-ltermlib.ln;
226
227# install rule for 64 bit lint library target
228$(ROOTLINTDIR64)/%: ../screen/%
229	$(INS.file)
230	cd $(ROOTLINTDIR64); \
231		$(RM) llib-ltermcap llib-ltermlib ; \
232		$(SYMLINK) ./llib-lcurses llib-ltermcap; \
233		$(SYMLINK) ./llib-lcurses llib-ltermlib; \
234		$(RM) llib-ltermcap.ln llib-ltermlib.ln ; \
235		$(SYMLINK) ./llib-lcurses.ln llib-ltermcap.ln; \
236		$(SYMLINK) ./llib-lcurses.ln llib-ltermlib.ln;
237