view libcruft/Makerules.in @ 2588:ccd72573a0cf

[project @ 1996-12-12 08:26:55 by jwe]
author jwe
date Thu, 12 Dec 1996 08:28:49 +0000
parents 8ddee13d19f9
children a5a300c61159
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)" = true ]; then \
	  if [ -n "$(FPICFLAG)" ]; then \
	    if [ -d pic ]; then \
	      true ; \
	    else \
	      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