fixed test in Makefiles for LIBTOOL for the case where it doesn't exist
[mmh] / zotnet / Makefile.in
index 7391814..4f43ffb 100644 (file)
@@ -12,6 +12,8 @@ VPATH  = @srcdir@
 LORDER = @LORDER@
 TSORT  = @TSORT@
 RANLIB = @RANLIB@
+LIBTOOL = @LIBTOOL@
+GNU_LIBTOOL = @GNU_LIBTOOL@
 
 # flags passed to recursive makes in subdirectories
 MAKEDEFS = CC='$(CC)' CPPFLAGS='$(CPPFLAGS)' DEFS='$(DEFS)' \
@@ -41,9 +43,13 @@ SUBDIRS = mts tws mf bboards
 all: all-recursive libzot.a
 
 libzot.a: $(OBJS)
-       rm -f libzot.a
-       ar cr libzot.a `$(LORDER) $(OBJS) | $(TSORT)`
-       $(RANLIB) libzot.a
+       rm -f $@
+       if test x$(LIBTOOL) != x -a x$(GNU_LIBTOOL) = x ; then \
+         $(LIBTOOL) -static -c $(OBJS) -o $@  ; \
+       else \
+         ar cr $@ `$(LORDER) $(OBJS) | $(TSORT)`  ; \
+         $(RANLIB) $@  ; \
+       fi 
 
 all-recursive:
        for subdir in $(SUBDIRS); do \