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