view libcruft/Makerules.in @ 6210:12b676a0b183 before-graphics-branch

[project @ 2006-12-07 02:37:17 by jwe]
author jwe
date Thu, 07 Dec 2006 02:37:17 +0000
parents 2eb0723b4fad
children 2298ae7ff342
line wrap: on
line source

# @configure_input@
#
# Common rules for octave's libcruft directories.
#
# FIXME -- 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

DLL_CDEFS = @CRUFT_DLL_DEFS@
DLL_CXXDEFS = @CRUFT_DLL_DEFS@

SOURCES = *.f

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

CRUFT_FSRC = $(wildcard $(srcdir)/*.f)
CRUFT_CSRC = $(wildcard $(srcdir)/*.c)
CRUFT_CXXSRC = $(wildcard $(srcdir)/*.cc)
CRUFT_SRC = $(CRUFT_FSRC) $(CRUFT_CSRC) $(CRUFT_CXXSRC)
CRUFT_BASE = $(basename $(notdir $(CRUFT_SRC)) )
CRUFT_OBJ = $(addsuffix .o, $(CRUFT_BASE) )
CRUFT_DEFS = $(patsubst %.f, %.def, $(notdir $(CRUFT_FSRC)))

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 $(CRUFT_DEFS) $(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

$(CRUFT_DEFS): $(TOPDIR)/libcruft/mkf77def

%.def : %.f
	@echo "making $@ from $<"
	@$(TOPDIR)/libcruft/mkf77def < $< > $@-t
	@$(simple-move-if-change-rule)

install:: all
.PHONY: install

install-strip:: all
.PHONY: install-strip

uninstall::
.PHONY: uninstall

tags: $(SOURCES)
	ctags $(SOURCES)

TAGS: $(SOURCES)
	etags $(SOURCES)

clean mostlyclean distclean maintainer-clean::
	rm -f $(MAKEDEPS) $(CRUFT_OBJ) $(CRUFT_PICOBJ) $(CRUFT_DEFS)
	-rmdir pic
	rm -f stmp-pic
.PHONY: clean mostlyclean

distclean maintainer-clean::
	rm -f Makefile
.PHONY: distclean
	
maintainer-clean::
	rm -f tags TAGS
.PHONY: maintainer-clean

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