view libcruft/Makerules.in @ 2489:269ecd74cebe

[project @ 1996-11-08 22:39:07 by jwe] Makefile.in
author jwe
date Fri, 08 Nov 1996 22:39:07 +0000
parents 4fc9fd1424a9
children 8ddee13d19f9
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_CSRC = $(patsubst %.f, %.c, $(CRUFT_BASE))
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

local-dist:
	ln $(DISTFILES) ../../`cat ../../.fname`/libcruft/$(THISDIR)
.PHONY: local-dist

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