#
# Makefile for octave's libcruft/misc directory
#
# John W. Eaton
# jwe@bevo.che.wisc.edu
# University of Wisconsin-Madison
# Department of Chemical Engineering

TOPDIR = ../..

srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@

SPECIAL := machar.c d1mach-tst.for dostop.c f77-extern.cc \
	f77-fcn.c f77-fcn.h lo-error.c lo-error.h

SPECIAL_DEPEND := machar.o dostop.o f77-extern.o f77-fcn.o lo-error.o

EXTERNAL_DISTFILES = $(DISTFILES)

include $(TOPDIR)/Makeconf

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@

ifeq ($(SHARED_LIBS), true)
  ifdef CPICFLAG
    CPICDEP := pic/machar.o pic/dostop.o pic/f77-fcn.o
  endif
  ifdef CXXPICFLAG
    CXXPICDEP := pic/f77-extern.o pic/lo-error.o
  endif
  SPECIAL_PICDEPEND := $(CPICDEP) $(CXXPICDEP)
endif

include ../Makerules

install::
	$(top_srcdir)/mkinstalldirs $(octincludedir)
	$(INSTALL_DATA) $(srcdir)/f77-fcn.h $(octincludedir)/f77-fcn.h
	$(INSTALL_DATA) $(srcdir)/lo-error.h $(octincludedir)/lo-error.h
	$(mk-includedir-link)

uninstall::
	rm -f $(octincludedir)/f77-fcn.h

# Don't optimize.

XCC = $(patsubst -O%, , $(CC))
XALL_CFLAGS = $(patsubst -O%, , $(ALL_CFLAGS))

machar.o: $(srcdir)/machar.c
	$(XCC) -c $(CPPFLAGS) $(XALL_CFLAGS) -DDP $<

pic/machar.o: $(srcdir)/machar.c
	$(XCC) -c $(CPPFLAGS) $(CPICFLAG) $(XALL_CFLAGS) -DDP $< -o $@
