view libcruft/Makerules.in @ 5018:1c65a8e44ef9 ss-2-1-59

[project @ 2004-09-22 03:33:29 by jwe]
author jwe
date Wed, 22 Sep 2004 03:33:29 +0000
parents 0bca8443db39
children ef1ac9acc43e
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_SRC = $(wildcard $(srcdir)/*.f) \
             $(wildcard $(srcdir)/*.c) \
             $(wildcard $(srcdir)/*.cc)
CRUFT_BASE = $(basename $(notdir $(CRUFT_SRC)) )
CRUFT_OBJ = $(addsuffix .o, $(CRUFT_BASE) )

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

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

LIBCRUFT_OBJS = $(CRUFT_OBJ) $(SPECIAL_DEPEND)

ifeq ($(STATIC_LIBS), true)
  LIBCRUFT_DEPEND := $(LIBCRUFT_OBJS)
endif

all: pic $(LIBCRUFT_DEPEND) $(CRUFT_PICOBJ) $(SPECIAL_PICDEPEND)
	@echo "warning: run make in parent directory to update libraries"
.PHONY: all

.PRECIOUS: $(LIBCRUFT_OBJS)

stmp-pic: pic
	@if [ -f stmp-pic ]; then \
	  true; \
	else \
	  echo "touch stmp-pic"; \
	  touch stmp-pic; \
	fi

pic:
	@if [ -d pic ]; then \
	  true; \
	else \
	  echo "mkdir pic"; \
	  mkdir pic; \
	fi

$(CRUFT_PICOBJ): stmp-pic

install:: all
.PHONY: install

uninstall::
.PHONY: uninstall

tags: $(SOURCES)
	ctags $(SOURCES)

TAGS: $(SOURCES)
	etags $(SOURCES)

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

mostlyclean::
	rm -f *.d *.o pic/*.o
	-rmdir pic
	rm -f stmp-pic
.PHONY: mostlyclean

distclean::
	rm -f *.d *.a *.o pic/*.o
	-rmdir pic
	rm -f stmp-pic
	rm -f Makefile
.PHONY: distclean
	
maintainer-clean::
	rm -f *.d *.a *.o pic/*.o
	-rmdir pic
	rm -f stmp-pic
	rm -f Makefile
	rm -f tags TAGS
.PHONY: maintainer-clean

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