# makefile for local CHAPTER
SHELL=/bin/sh

SRC= zero_find.c quantum.c randu.c
OBJ= zero_find.o quantum.o randu.o
FUN=
HELPSGML=
HELPRD=

# Use LOCAL_CFLAGS to add arguments for the C compiler
LOCAL_CFLAGS=
# Use LOCAL_CXXFLAGS to add arguments for the C++ compiler
LOCAL_CXXFLAGS=
# Use LOCAL_FFLAGS to add arguments for the FORTRAN compiler
LOCAL_FFLAGS=

# Use LOCAL_LIBS to add arguments or additional libraries to the linker
# LOCAL_LIBS="-lf2c"
LOCAL_LIBS=

include $(SHOME)/library/S_FLAGS
# Uncomment following line to make debuggable, not optimized, compiled code.
# OPTIMIZE_FLAG=-g

all: install.funs S.so install.help

install.funs: $(FUN)
	@if [ "X$(FUN)" != "X" ] ; then \
	( echo "if(file.exists(\"../DESCRIPTION\")) attachPackageDependencies(descriptionFile = \"../DESCRIPTION\")" ; cat $(FUN)) | $(SHOME)/cmd/Splus ; \
	fi

install.help: $(HELPSGML)
	@if [ "X$(HELPSGML)" != "X" ] ; then \
	$(SHOME)/cmd/Splus HINSTALL ./.Data $(HELPSGML) ; \
	$(SHOME)/cmd/Splus BUILD_JHELP ; \
	fi

install.Rdhelp: $(HELPRD)
	@if [ "X$(HELPRD)" != "X" ] ; then \
	$(SHOME)/cmd/Splus RDINSTALL ./.Data $(HELPRD) ; \
	$(SHOME)/cmd/Splus BUILD_JHELP ; \
	fi

S.so: $(OBJ) 
	@if [ "X$(OBJ)" != "X" ]; then \
	$(SHOME)/cmd/Splus LIBRARY S.so $(OBJ) $(LOCAL_LIBS) $(SQPE_SHARED_LIB) ; \
	fi

dump:
	@if test -d ./.Data; then Splus dumpChapter $(SRC); fi

boot:
	@if test -s all.Sdata; \
	  then (BOOTING_S="TRUE" export BOOTING_S; echo "terminate(should have been booting S)"| $(SHOME)/cmd/Splus); \
	fi

clean:
	-rm $(OBJ)

