ncurses 6.2 - patch 20200711
[ncurses.git] / mk-1st.awk
1 # $Id: mk-1st.awk,v 1.107 2020/04/04 14:07:40 anonymous.maarten Exp $
2 ##############################################################################
3 # Copyright 2018,2020 Thomas E. Dickey                                       #
4 # Copyright 1998-2016,2017 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
32 #
33 # Generate list of objects for a given model library
34 # Variables:
35 #       name              (library name, e.g., "ncurses", "panel", "forms", "menus")
36 #       traces            ("all" or "DEBUG", to control whether tracing is compiled in)
37 #       MODEL             (e.g., "DEBUG", uppercase; toupper is not portable)
38 #       CXX_MODEL         (e.g., "DEBUG", uppercase)
39 #       model             (directory into which we compile, e.g., "obj")
40 #       prefix            (e.g., "lib", for Unix-style libraries)
41 #       suffix            (e.g., "_g.a", for debug libraries)
42 #       subset            ("none", "base", "base+ext_funcs" or "termlib", etc.)
43 #       driver            ("yes" or "no", depends on --enable-term-driver)
44 #       ShlibVer          ("rel", "abi" or "auto", to augment DoLinks variable)
45 #       ShlibVerInfix ("yes" or "no", determines location of version #)
46 #       SymLink           ("ln -s", etc)
47 #       TermlibRoot       ("tinfo" or other root for libterm.so)
48 #       TermlibSuffix (".so" or other suffix for libterm.so)
49 #       ReLink            ("yes", or "no", flag to rebuild shared libs on install)
50 #       ReRanlib          ("yes", or "no", flag to rerun ranlib for installing static)
51 #       DoLinks           ("yes", "reverse" or "no", flag to add symbolic links)
52 #       rmSoLocs          ("yes" or "no", flag to add extra clean target)
53 #       ldconfig          (path for this tool, if used)
54 #       overwrite         ("yes" or "no", flag to add link to libcurses.a
55 #       depend            (optional dependencies for all objects, e.g, ncurses_cfg.h)
56 #       host              (cross-compile host, if any)
57 #       libtool_version (libtool "-version-info" or "-version-number")
58 #
59 # Notes:
60 #       CLIXs nawk does not like underscores in command-line variable names.
61 #       Mixed-case variable names are ok.
62 #       HP/UX requires shared libraries to have executable permissions.
63 #
64 function is_ticlib() {
65                 return ( subset ~ /^ticlib$/ );
66         }
67 function is_termlib() {
68                 return ( subset ~ /^(ticlib\+)?termlib((\+[^+ ]+)*\+[a-z_]+_tinfo)?$/ );
69         }
70 # see lib_name
71 function lib_name_of(a_name) {
72                 return sprintf("%s%s%s", prefix, a_name, suffix)
73         }
74 # see imp_name
75 function imp_name_of(a_name) {
76                 if (ShlibVerInfix == "cygdll" || ShlibVerInfix == "msysdll" || ShlibVerInfix == "mingw") {
77                         result = sprintf("%s%s%s.a", prefix, a_name, suffix);
78                 } else if (ShlibVerInfix == "msvcdll") {
79                         result = sprintf("%s%s%s.lib", prefix, a_name, suffix);
80                 } else{
81                         result = "";
82                 }
83                 return result;
84         }
85 # see abi_name
86 function abi_name_of(a_name) {
87                 if (ShlibVerInfix == "cygdll") {
88                         result = sprintf("%s%s$(ABI_VERSION)%s", "cyg", a_name, suffix);
89                 } else if (ShlibVerInfix == "msysdll") {
90                         result = sprintf("%s%s$(ABI_VERSION)%s", "msys-", a_name, suffix);
91                 } else if (ShlibVerInfix == "mingw" || ShlibVerInfix == "msvcdll") {
92                         result = sprintf("%s%s$(ABI_VERSION)%s", prefix, a_name, suffix);
93                 } else if (ShlibVerInfix == "yes") {
94                         result = sprintf("%s%s.$(ABI_VERSION)%s", prefix, a_name, suffix);
95                 } else {
96                         result = sprintf("%s.$(ABI_VERSION)", lib_name_of(a_name));
97                 }
98                 return result;
99         }
100 # see rel_name
101 function rel_name_of(a_name) {
102                 if (ShlibVerInfix == "cygdll") {
103                         result = sprintf("%s%s$(REL_VERSION)%s", "cyg", a_name, suffix);
104                 } else if (ShlibVerInfix == "msysdll") {
105                         result = sprintf("%s%s$(ABI_VERSION)%s", "msys-", a_name, suffix);
106                 } else if (ShlibVerInfix == "mingw" || ShlibVerInfix == "msvcdll") {
107                         result = sprintf("%s%s$(REL_VERSION)%s", prefix, a_name, suffix);
108                 } else if (ShlibVerInfix == "yes") {
109                         result = sprintf("%s%s.$(REL_VERSION)%s", prefix, a_name, suffix);
110                 } else {
111                         result = sprintf("%s.$(REL_VERSION)", lib_name_of(a_name));
112                 }
113                 return result;
114         }
115 # see end_name
116 function end_name_of(a_name) {
117                 if ( MODEL != "SHARED" ) {
118                         result = lib_name_of(a_name);
119                 } else if ( DoLinks == "reverse") {
120                         result = lib_name_of(a_name);
121                 } else {
122                         if ( ShlibVer == "rel" ) {
123                                 result = rel_name_of(a_name);
124                         } else if ( ShlibVer == "abi" || ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || ShlibVer == "msvcdll" ) {
125                                 result = abi_name_of(a_name);
126                         } else {
127                                 result = lib_name_of(a_name);
128                         }
129                 }
130                 return result
131         }
132 function symlink(src,dst) {
133                 if ( src != dst ) {
134                         if ( SymLink !~ /.*-f.*/ ) {
135                                 printf "rm -f %s; ", dst
136                         }
137                         printf "$(LN_S) %s %s; ", src, dst
138                 }
139         }
140 function rmlink(directory, dst) {
141                 if ( dst != "" ) {
142                         printf "\t-rm -f %s/%s\n", directory, dst
143                 }
144         }
145 function removelinks(directory) {
146                 nlinks = 0;
147                 links[nlinks++] = end_name;
148                 if ( DoLinks == "reverse" ) {
149                         if ( ShlibVer == "rel" ) {
150                                 links[nlinks++] = abi_name;
151                                 links[nlinks++] = rel_name;
152                         } else if ( ShlibVer == "abi" ) {
153                                 links[nlinks++] = abi_name;
154                         }
155                 } else {
156                         if ( ShlibVer == "rel" ) {
157                                 links[nlinks++] = abi_name;
158                                 links[nlinks++] = lib_name;
159                         } else if ( ShlibVer == "abi" ) {
160                                 links[nlinks++] = lib_name;
161                         }
162                 }
163                 for (j = 0; j < nlinks; ++j) {
164                         found = 0;
165                         for (k = 0; k < j; ++k ) {
166                                 if ( links[j] == links[k] ) {
167                                         found = 1;
168                                         break;
169                                 }
170                         }
171                         if ( !found ) {
172                                 rmlink(directory, links[j]);
173                         }
174                 }
175         }
176 function make_shlib(objs, shlib_list) {
177                 printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(%s)\n", objs, shlib_list
178         }
179 function sharedlinks(directory) {
180                 if ( ShlibVer != "auto" && ShlibVer != "cygdll" && ShlibVer != "msysdll" && ShlibVer != "mingw" && ShlibVer != "msvcdll" ) {
181                         printf "\tcd %s && (", directory
182                         if ( DoLinks == "reverse" ) {
183                                 if ( ShlibVer == "rel" ) {
184                                         symlink(lib_name, abi_name);
185                                         symlink(abi_name, rel_name);
186                                 } else if ( ShlibVer == "abi" ) {
187                                         symlink(lib_name, abi_name);
188                                 }
189                         } else {
190                                 if ( ShlibVer == "rel" ) {
191                                         symlink(rel_name, abi_name);
192                                         symlink(abi_name, lib_name);
193                                 } else if ( ShlibVer == "abi" ) {
194                                         symlink(abi_name, lib_name);
195                                 }
196                         }
197                         printf ")\n"
198                 }
199         }
200 # termlib may be named explicitly via "--with-termlib=XXX", which overrides
201 # any suffix.  Temporarily override "suffix" to account for this.
202 function termlib_end_of() {
203         termlib_save_suffix = suffix;
204         suffix = TermlibSuffix;
205         termlib_temp_result = end_name_of(TermlibRoot);
206         suffix = termlib_save_suffix;
207         return termlib_temp_result;
208 }
209 function shlib_build(directory) {
210                 dst_libs = sprintf("%s/%s", directory, end_name);
211                 printf "%s : \\\n", dst_libs
212                 if (subset == "ticlib" && driver == "yes" ) {
213                         base = name;
214                         sub(/^tic/, "ncurses", base); # workaround for "w"
215                         printf "\t\t%s/%s \\\n", directory, end_name_of(base);
216                 }
217                 if (subset ~ /^base/ || subset == "ticlib" ) {
218                         save_suffix = suffix
219                         sub(/^[^.]\./,".",suffix)
220                         if (directory != "../lib") {
221                                 printf "\t\t%s/%s \\\n", "../lib", termlib_end_of();
222                         }
223                         printf "\t\t%s/%s \\\n", directory, termlib_end_of();
224                         suffix = save_suffix
225                 }
226                 printf "\t\t$(RESULTING_SYMS) $(%s_OBJS)\n", OBJS
227                 printf "\t@echo linking $@\n"
228                 printf "\t@mkdir -p %s\n", directory
229                 if ( ReLink != "yes" ) {
230                         printf "\t@sleep 1\n"
231                 }
232                 if ( is_ticlib() ) {
233                         make_shlib(OBJS, "TICS_LIST")
234                 } else if ( is_termlib() ) {
235                         make_shlib(OBJS, "TINFO_LIST")
236                 } else {
237                         make_shlib(OBJS, "SHLIB_LIST")
238                 }
239                 sharedlinks(directory)
240         }
241 function shlib_install(directory) {
242                 src_lib1 = sprintf("../lib/%s", end_name);
243                 dst_lib1 = sprintf("%s/%s", directory, end_name);
244                 printf "%s : \\\n", dst_lib1
245                 printf "\t\t%s \\\n", directory
246                 printf "\t\t%s\n", src_lib1
247                 printf "\t@echo installing $@\n"
248                 printf "\t$(INSTALL_LIB) %s %s\n", src_lib1, dst_lib1;
249                 sharedlinks(directory)
250         }
251 function install_dll(directory,filename) {
252                 src_name = sprintf("../lib/%s", filename);
253                 dst_name = sprintf("$(DESTDIR)%s/%s", directory, filename);
254                 printf "\t@echo installing %s as %s\n", src_name, dst_name
255                 if ( directory == "$(bindir)" ) {
256                         program = "$(INSTALL) -m 755";
257                 } else {
258                         program = "$(INSTALL_LIB)";
259                 }
260                 printf "\t%s %s %s\n", program, src_name, dst_name
261         }
262 BEGIN   {
263                 TOOL_PREFIX = "";
264                 found = 0;
265                 using = 0;
266         }
267         /^@/ {
268                 using = 0
269                 if (subset == "none") {
270                         using = 1
271                 } else if (index(subset,$2) > 0) {
272                         if (using == 0) {
273                                 if (found == 0) {
274                                         if ( name ~ /^.*\+\+.*/ ) {
275                                                 if ( CXX_MODEL == "NORMAL" && MODEL == "SHARED" ) {
276                                                         print  ""
277                                                         printf "# overriding model from %s to match CXX_MODEL\n", MODEL;
278                                                         MODEL = "NORMAL";
279                                                         suffix = ".a";
280                                                         DoLinks = "no";
281                                                 }
282                                         }
283                                         print  ""
284                                         printf "# generated by mk-1st.awk (subset=%s)\n", subset
285                                         printf "#  name:          %s\n", name 
286                                         printf "#  traces:        %s\n", traces 
287                                         printf "#  MODEL:         %s\n", MODEL 
288                                         printf "#  CXX_MODEL:     %s\n", CXX_MODEL 
289                                         printf "#  model:         %s\n", model 
290                                         printf "#  prefix:        %s\n", prefix 
291                                         printf "#  suffix:        %s\n", suffix 
292                                         printf "#  subset:        %s\n", subset 
293                                         printf "#  driver:        %s\n", driver 
294                                         printf "#  ShlibVer:      %s\n", ShlibVer 
295                                         printf "#  ShlibVerInfix: %s\n", ShlibVerInfix 
296                                         printf "#  SymLink:       %s\n", SymLink 
297                                         printf "#  TermlibRoot:   %s\n", TermlibRoot 
298                                         printf "#  TermlibSuffix: %s\n", TermlibSuffix 
299                                         printf "#  ReLink:        %s\n", ReLink 
300                                         printf "#  ReRanlib:      %s\n", ReRanlib 
301                                         printf "#  DoLinks:       %s\n", DoLinks 
302                                         printf "#  rmSoLocs:      %s\n", rmSoLocs 
303                                         printf "#  ldconfig:      %s\n", ldconfig 
304                                         printf "#  overwrite:     %s\n", overwrite 
305                                         printf "#  depend:        %s\n", depend 
306                                         printf "#  host:          %s\n", host 
307                                         print  ""
308                                 }
309                                 using = 1
310                         }
311                         if ( is_ticlib() ) {
312                                 OBJS  = MODEL "_P"
313                         } else if ( is_termlib() ) {
314                                 OBJS  = MODEL "_T"
315                         } else {
316                                 OBJS  = MODEL
317                         }
318                 }
319         }
320         /^[@#]/ {
321                 next
322         }
323         $1 ~ /trace/ {
324                 if (traces != "all" && traces != MODEL && $1 != "lib_trace")
325                         next
326         }
327         {
328                 if (using \
329                  && ( $1 != "link_test" ) \
330                  && ( $2 == "lib" \
331                    || $2 == "progs" \
332                    || $2 == "c++" \
333                    || $2 == "tack" ))
334                 {
335                         if ( found == 0 )
336                         {
337                                 printf "%s_OBJS =", OBJS
338                                 if ( $2 == "lib" ) {
339                                         found = 1;
340                                 } else if ( $2 == "c++" ) {
341                                         TOOL_PREFIX = "CXX_";
342                                         found = 1;
343                                 } else {
344                                         found = 2;
345                                 }
346                                 if ( $2 == "c++" ) {
347                                         CC_NAME="CXX"
348                                         CC_FLAG="CXXFLAGS"
349                                 } else {
350                                         CC_NAME="CC"
351                                         CC_FLAG="CFLAGS"
352                                 }
353                         }
354                         printf " \\\n\t../%s/%s$o", model, $1;
355                 }
356         }
357 END     {
358                 print  ""
359                 if ( found != 0 )
360                 {
361                         printf "\n$(%s_OBJS) : %s\n", OBJS, depend
362                 }
363                 if ( found == 1 )
364                 {
365                         print  ""
366                         lib_name = lib_name_of(name);
367                         if ( MODEL == "SHARED" )
368                         {
369                                 abi_name = abi_name_of(name);
370                                 rel_name = rel_name_of(name);
371                                 imp_name = imp_name_of(name);
372                                 end_name = end_name_of(name);
373
374                                 shlib_build("../lib")
375
376                                 print  ""
377                                 print  "install \\"
378                                 print  "install.libs \\"
379
380                                 if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || ShlibVer == "msvcdll") {
381
382                                         dst_dirs = "$(DESTDIR)$(bindir) $(DESTDIR)$(libdir)";
383                                         printf "install.%s :: %s $(LIBRARIES)\n", name, dst_dirs
384                                         install_dll("$(bindir)",end_name);
385                                         install_dll("$(libdir)",imp_name);
386
387                                 } else {
388
389                                         lib_dir = "$(DESTDIR)$(libdir)";
390                                         printf "install.%s :: %s/%s\n", name, lib_dir, end_name
391                                         print ""
392                                         if ( ReLink == "yes" ) {
393                                                 shlib_build(lib_dir)
394                                         } else {
395                                                 shlib_install(lib_dir)
396                                         }
397                                 }
398
399                                 if ( overwrite == "yes" && name == "ncurses" )
400                                 {
401                                         if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || SlibVer == "msvcdll") {
402                                                 if (ShlibVer == "msvcdll") {
403                                                         curses_prefix = ""
404                                                 } else {
405                                                         curses_prefix = "lib"
406                                                 }
407                                                 ovr_name = sprintf("%scurses%s.a", curses_prefix, suffix)
408                                                 printf "\t@echo linking %s to %s\n", imp_name, ovr_name
409                                                 printf "\tcd $(DESTDIR)$(libdir) && ("
410                                                 symlink(imp_name, ovr_name)
411                                                 printf ")\n"
412                                         } else {
413                                                 ovr_name = sprintf("libcurses%s", suffix)
414                                                 printf "\t@echo linking %s to %s\n", end_name, ovr_name
415                                                 printf "\tcd $(DESTDIR)$(libdir) && ("
416                                                 symlink(end_name, ovr_name)
417                                                 printf ")\n"
418                                         }
419                                 }
420                                 if ( ldconfig != "" && ldconfig != ":" ) {
421                                         printf "\t- test -z \"$(DESTDIR)\" && %s\n", ldconfig
422                                 }
423                                 print  ""
424                                 print  "uninstall \\"
425                                 print  "uninstall.libs \\"
426                                 printf "uninstall.%s ::\n", name
427                                 if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || ShlibVer == "msvcdll") {
428
429                                         printf "\t@echo uninstalling $(DESTDIR)$(bindir)/%s\n", end_name
430                                         printf "\t-@rm -f $(DESTDIR)$(bindir)/%s\n", end_name
431
432                                         printf "\t@echo uninstalling $(DESTDIR)$(libdir)/%s\n", imp_name
433                                         printf "\t-@rm -f $(DESTDIR)$(libdir)/%s\n", imp_name
434
435                                 } else {
436                                         printf "\t@echo uninstalling $(DESTDIR)$(libdir)/%s\n", end_name
437                                         removelinks("$(DESTDIR)$(libdir)")
438                                         if ( overwrite == "yes" && name == "ncurses" )
439                                         {
440                                                 ovr_name = sprintf("libcurses%s", suffix)
441                                                 printf "\t-@rm -f $(DESTDIR)$(libdir)/%s\n", ovr_name
442                                         }
443                                 }
444                                 if ( rmSoLocs == "yes" ) {
445                                         print  ""
446                                         print  "mostlyclean \\"
447                                         print  "clean ::"
448                                         printf "\t-@rm -f so_locations\n"
449                                 }
450                         }
451                         else if ( MODEL == "LIBTOOL" )
452                         {
453                                 end_name = lib_name;
454                                 printf "../lib/%s : $(%s_OBJS)\n", lib_name, OBJS
455                                 if ( is_ticlib() ) {
456                                         which_list = "TICS_LIST";
457                                 } else if ( is_termlib() ) {
458                                         which_list = "TINFO_LIST";
459                                 } else {
460                                         which_list = "SHLIB_LIST";
461                                 }
462                                 printf "\tcd ../lib && $(LIBTOOL_LINK) $(%s) $(%s) \\\n", CC_NAME, CC_FLAG;
463                                 printf "\t\t-o %s $(%s_OBJS:$o=.lo) \\\n", lib_name, OBJS;
464                                 printf "\t\t-rpath $(libdir) \\\n";
465                                 printf "\t\t%s $(NCURSES_MAJOR):$(NCURSES_MINOR) $(LT_UNDEF) $(%s) $(LDFLAGS)\n", libtool_version, which_list;
466                                 print  ""
467                                 print  "install \\"
468                                 print  "install.libs \\"
469                                 printf "install.%s :: $(DESTDIR)$(libdir) ../lib/%s\n", name, lib_name
470                                 printf "\t@echo installing ../lib/%s as $(DESTDIR)$(libdir)/%s\n", lib_name, lib_name
471                                 printf "\tcd ../lib; $(LIBTOOL_INSTALL) $(INSTALL) %s $(DESTDIR)$(libdir)\n", lib_name
472                                 print  ""
473                                 print  "uninstall \\"
474                                 print  "uninstall.libs \\"
475                                 printf "uninstall.%s ::\n", name
476                                 printf "\t@echo uninstalling $(DESTDIR)$(libdir)/%s\n", lib_name
477                                 printf "\t-@$(LIBTOOL_UNINSTALL) rm -f $(DESTDIR)$(libdir)/%s\n", lib_name
478                         }
479                         else
480                         {
481                                 end_name = lib_name;
482                                 printf "../lib/%s : $(%s_OBJS)\n", lib_name, OBJS
483                                 # workaround: binutils' ranlib tries to be clever with
484                                 # timestamps, by pretending its update took no time, confusing
485                                 # the make utility.
486                                 if ( ReLink != "yes" ) {
487                                         printf "\t@sleep 1\n"
488                                 }
489                                 printf "\t$(%sAR) $(%sARFLAGS) $@ $?\n", TOOL_PREFIX, TOOL_PREFIX;
490                                 printf "\t$(RANLIB) $@\n"
491                                 if ( host == "vxworks" )
492                                 {
493                                         printf "\t$(LD) $(LD_OPTS) $? -o $(@:.a=$o)\n"
494                                 }
495                                 print  ""
496                                 print  "install \\"
497                                 print  "install.libs \\"
498                                 printf "install.%s :: $(DESTDIR)$(libdir) ../lib/%s\n", name, lib_name
499                                 printf "\t@echo installing ../lib/%s as $(DESTDIR)$(libdir)/%s\n", lib_name, lib_name
500                                 printf "\t$(INSTALL_DATA) ../lib/%s $(DESTDIR)$(libdir)/%s\n", lib_name, lib_name
501                                 if ( overwrite == "yes" && lib_name == "libncurses.a" )
502                                 {
503                                         printf "\t@echo linking libcurses.a to libncurses.a\n"
504                                         printf "\t-@rm -f $(DESTDIR)$(libdir)/libcurses.a\n"
505                                         printf "\t(cd $(DESTDIR)$(libdir) && "
506                                         symlink("libncurses.a", "libcurses.a")
507                                         printf ")\n"
508                                 }
509                                 if ( ReRanlib == "yes" )
510                                 {
511                                         printf "\t$(RANLIB) $(DESTDIR)$(libdir)/%s\n", lib_name
512                                 }
513                                 if ( host == "vxworks" )
514                                 {
515                                         printf "\t@echo installing ../lib/lib%s$o as $(DESTDIR)$(libdir)/lib%s$o\n", name, name
516                                         printf "\t$(INSTALL_DATA) ../lib/lib%s$o $(DESTDIR)$(libdir)/lib%s$o\n", name, name
517                                 }
518                                 print  ""
519                                 print  "uninstall \\"
520                                 print  "uninstall.libs \\"
521                                 printf "uninstall.%s ::\n", name
522                                 printf "\t@echo uninstalling $(DESTDIR)$(libdir)/%s\n", lib_name
523                                 printf "\t-@rm -f $(DESTDIR)$(libdir)/%s\n", lib_name
524                                 if ( overwrite == "yes" && lib_name == "libncurses.a" )
525                                 {
526                                         printf "\t@echo linking libcurses.a to libncurses.a\n"
527                                         printf "\t-@rm -f $(DESTDIR)$(libdir)/libcurses.a\n"
528                                 }
529                                 if ( host == "vxworks" )
530                                 {
531                                         printf "\t@echo uninstalling $(DESTDIR)$(libdir)/lib%s$o\n", name
532                                         printf "\t-@rm -f $(DESTDIR)$(libdir)/lib%s$o\n", name
533                                 }
534                         }
535                         print ""
536                         print "clean ::"
537                         removelinks("../lib");
538                         print ""
539                         print "mostlyclean::"
540                         printf "\t-rm -f $(%s_OBJS)\n", OBJS
541                         if ( MODEL == "LIBTOOL" ) {
542                                 printf "\t-$(LIBTOOL_CLEAN) rm -f $(%s_OBJS:$o=.lo)\n", OBJS
543                         }
544                 }
545                 else if ( found == 2 )
546                 {
547                         print ""
548                         print "mostlyclean::"
549                         printf "\t-rm -f $(%s_OBJS)\n", OBJS
550                         if ( MODEL == "LIBTOOL" ) {
551                                 printf "\t-$(LIBTOOL_CLEAN) rm -f $(%s_OBJS:$o=.lo)\n", OBJS
552                         }
553                         print ""
554                         print "clean ::"
555                         printf "\t-rm -f $(%s_OBJS)\n", OBJS
556                         if ( MODEL == "LIBTOOL" ) {
557                                 printf "\t-$(LIBTOOL_CLEAN) rm -f $(%s_OBJS:$o=.lo)\n", OBJS
558                         }
559                 }
560         }
561 # vile:ts=4 sw=4