]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - mk-2nd.awk
ncurses 5.1
[ncurses.git] / mk-2nd.awk
index 9240b4707a1b1dd15133f2d5d5ff024dc8745801..e90f16d038827c21c1097b01de971187693d1c98 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: mk-2nd.awk,v 1.10 1998/02/11 12:13:53 tom Exp $
+# $Id: mk-2nd.awk,v 1.12 2000/04/01 20:50:36 tom Exp $
 ##############################################################################
 # Copyright (c) 1998 Free Software Foundation, Inc.                          #
 #                                                                            #
@@ -67,7 +67,14 @@ BEGIN        {
                        }
                }
        }
-       !/^[@#]/ {
+       /^[@#]/ {
+               next
+       }
+       $1 ~ /trace/ {
+               if (traces != "all" && traces != MODEL && $1 != "lib_trace")
+                       next
+       }
+       {
                if ($0 != "" \
                 && using != 0) {
                        found = 1
@@ -89,9 +96,12 @@ BEGIN        {
                                        atsign="@"
                                        printf "\t@echo 'compiling %s (%s)'\n", $1, model
                                }
-                               if ( $3 == "." || srcdir == "." )
-                                       printf "\t%scd ../%s; $(%s) $(CFLAGS_%s) -c ../%s/%s%s", atsign, model, compile, MODEL, name, $1, suffix
-                               else
+                               if ( $3 == "." || srcdir == "." ) {
+                                       dir = $3 "/"
+                                       sub("^\\$\\(srcdir\\)/","",dir);
+                                       sub("^\\./","",dir);
+                                       printf "\t%scd ../%s; $(%s) $(CFLAGS_%s) -c ../%s/%s%s%s", atsign, model, compile, MODEL, name, dir, $1, suffix
+                               } else
                                        printf "\t%scd ../%s; $(%s) $(CFLAGS_%s) -c %s/%s%s", atsign, model, compile, MODEL, $3, $1, suffix
                        } else {
                                printf "%s", $1