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