view libcruft/Makerules.in @ 2992:53b38bf1d443

[project @ 1997-05-20 19:48:00 by jwe]
author jwe
date Tue, 20 May 1997 19:48:00 +0000
parents a5a300c61159
children 9ce32027e269
line wrap: on
line source

# @configure_input@
#
# Common rules for octave's libcruft directories.
#
# XXX FIXME XXX -- assumes that the libcruft directory tree is only
# one level deep.
#
# John W. Eaton
# jwe@bevo.che.wisc.edu
# University of Wisconsin-Madison
# Department of Chemical Engineering

SOURCES = *.f

DISTFILES = Makefile.in $(SOURCES) $(SPECIAL)

CRUFT_FSRC = $(wildcard $(srcdir)/*.f)
CRUFT_BASE = $(notdir $(CRUFT_FSRC))
CRUFT_OBJ = $(patsubst %.f, %.o, $(CRUFT_BASE))

ifeq ($(SHARED_LIBS), true)
  ifdef FPICFLAG
    CRUFT_PICOBJ := $(addprefix pic/, $(CRUFT_OBJ))
  endif
endif

CWD = $(shell pwd)
THISDIR = $(notdir $(CWD))

LIBCRUFT = ../libcruft.a

LIBCRUFT_OBJS = $(CRUFT_OBJ) $(SPECIAL_DEPEND)

LIBCRUFT_DEPS = $(LIBCRUFT)($(LIBCRUFT_OBJS))

all: stamp-picdir $(LIBCRUFT) $(CRUFT_PICOBJ) $(SPECIAL_PICDEPEND)
.PHONY: all

# Cancel the default action for when an archive member is out of
# date.  Instead of inserting the out of date members individually, we
# will insert them in batches, even if some of them are up to date.
# This is much faster for a large archive like libcruft.a.

(%) : %
	@true

$(LIBCRUFT): $(LIBCRUFT_DEPS)
	$(AR) $(ARFLAGS) $(LIBCRUFT) $(LIBCRUFT_OBJS)
	$(RANLIB) $(LIBCRUFT)

# This is necessary, otherwise we won't have any .o files left when it
# comes time to insert them in the archive.

.PRECIOUS: $(LIBCRUFT_OBJS)

stamp-picdir:
	@if $(SHARED_LIBS); then \
	  if [ -n "$(FPICFLAG)" ]; then \
	    if [ -d pic ]; then \
	      true ; \
	    else \
	      echo "mkdir pic" ; \
	      mkdir pic ; \
	    fi ; \
	  fi ; \
	else \
	  true ; \
	fi
	touch stamp-picdir

install:: all
.PHONY: install

uninstall::
.PHONY: uninstall

tags: $(SOURCES)
	ctags $(SOURCES)

TAGS: $(SOURCES)
	etags $(SOURCES)

clean::
	rm -f *.a *.o pic/*.o
.PHONY: clean

mostlyclean::
	rm -f *.o pic/*.o
.PHONY: mostlyclean

distclean:: clean
	rm -f Makefile stamp-picdir
	-rmdir pic
.PHONY: distclean
	
maintainer-clean::
	rm -f tags TAGS stamp-picdir Makefile
	-rmdir pic
.PHONY: maintainer-clean

dist:
	ln $(EXTERNAL_DISTFILES) ../../`cat ../../.fname`/libcruft/$(THISDIR)
.PHONY: dist