1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
$NetBSD: patch-af,v 1.1 1999/07/06 07:51:05 jlam Exp $
--- mk-2nd.awk.orig Wed Feb 11 07:13:53 1998
+++ mk-2nd.awk Tue Jun 29 17:47:39 1999
@@ -74,9 +74,11 @@
if ( $1 != "" ) {
print ""
if ( $2 == "c++" ) {
+ cplusplus="--cplusplus"
compile="CXX"
suffix=".cc"
} else {
+ cplusplus=""
compile="CC"
suffix=".c"
}
@@ -89,10 +91,17 @@
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
+ if ( $3 == "." || srcdir == "." ) {
+ libprefix="../"
+ dirname=name
+ } else {
+ libprefix=""
+ dirname=$3
+ }
+ if ( $2 == "lib" )
+ printf "\t%scd ../%s; $(LIBTOOL) %s --mode=compile $(%s) $(CFLAGS_%s) -c %s%s/%s%s", atsign, model, cplusplus, compile, MODEL, libprefix, dirname, $1, suffix
else
- printf "\t%scd ../%s; $(%s) $(CFLAGS_%s) -c %s/%s%s", atsign, model, compile, MODEL, $3, $1, suffix
+ printf "\t%scd ../%s; $(%s) $(CFLAGS_%s) -c %s%s/%s%s", atsign, model, compile, MODEL, libprefix, dirname, $1, suffix
} else {
printf "%s", $1
for (n = 2; n <= NF; n++) printf " %s", $n
|