
TAR_FILE_NAME		= pil-2.0.0

# NOTE: if you want alternate default settings uncomment 1 or 2 of the 
# following 2 lines before running configure.
# CFLAGS		+= -DSTARTUP_PIL_RL_PROMPT_EIB
# CFLAGS		+= -DSTARTUP_PIL_CMNDARG_ALLOW_SPACES

# =========================== LIBRARY TARGET =============================

LIB_SHORT_NAME		= pil

LIB_FULL_NAME		= libpil.a

LIB_SOURCES		= pil.c pil_error.c pil_f90_bind.c pil_sys.c \
			  ${LIB_F90_SOURCES}

_LIB_F90_SOURCES	= ${LIB_F90_EARLY_SOURCES} ${LIB_F90_INT8_SOURCES} \
			  pil_f90_api.f90

_LIB_F90_EARLY_SOURCES	= pil_f90_unix.f90

_LIB_F90_INT8_SOURCES	=

LIB_OBJECTS		= pil.o pil_error.o pil_f90_bind.o pil_sys.o \
			  ${LIB_F90_OBJECTS}

_LIB_F90_OBJECTS	= ${LIB_F90_EARLY_OBJECTS} ${LIB_F90_INT8_OBJECTS} \
                          pil_f90_api.o

_LIB_F90_EARLY_OBJECTS	= pil_f90_unix.o

_LIB_F90_INT8_OBJECTS	=

${LIB_FULL_NAME}:	${LIB_OBJECTS}
			ar -rv ${LIB_FULL_NAME} ${LIB_OBJECTS}
			${RANLIB} ${LIB_FULL_NAME}

library:		${LIB_FULL_NAME}

ALL_TARGETS		+= ${LIB_FULL_NAME}

TO_INSTALL_INC		+= pil.h pil_error.h
TO_INSTALL_LIB		+= ${LIB_FULL_NAME}
TO_INSTALL_HELP		+= doc/pil.ps
TO_INSTALL_F90MOD_NORMAL	+= pil_f90_api.${F90MOD_EXT}
TO_INSTALL_F90MOD_UPPER		+= PIL_F90_API.${F90MOD_EXT}
_TO_INSTALL_F90MOD_EARLY_NORMAL	+= f90_unix.${F90MOD_EXT}
_TO_INSTALL_F90MOD_EARLY_UPPER	+= F90_UNIX.${F90MOD_EXT}

# ========================= C EXECUTABLE TARGET  =========================

C_EXEC_1_NAME		= pilcdemo
C_EXEC_1_SOURCES	= pilcdemo.c
C_EXEC_1_OBJECTS	= pilcdemo.o
C_EXEC_1_LIBRARIES	= -lpil ${LAST_LIBS}

${C_EXEC_1_NAME}:	${C_EXEC_1_OBJECTS} ${LIB_FULL_NAME}
			${CC} ${ALL_C_CFLAGS} -o $@ $^ ${ALL_C_LDFLAGS} ${C_EXEC_1_LIBRARIES}

CLEAN_TARGETS		+= ${C_EXEC_1_NAME} ${C_EXEC_1_OBJECTS}
ALL_TARGETS		+= ${C_EXEC_1_NAME}

# ========================= C EXECUTABLE TARGET  =========================

C_EXEC_5_NAME		= ISDCcopy
C_EXEC_5_SOURCES	= ISDCcopy.c
C_EXEC_5_OBJECTS	= ISDCcopy.o
C_EXEC_5_LIBRARIES	= ${ISDC_COMMON_LIBS}

${C_EXEC_5_NAME}:	${C_EXEC_5_OBJECTS} ${LIB_FULL_NAME}
			${CC} ${ALL_C_CFLAGS} -o $@ $^ ${ALL_C_LDFLAGS} ${C_EXEC_5_LIBRARIES}

CLEAN_TARGETS		+= ${C_EXEC_5_NAME} ${C_EXEC_5_OBJECTS}

# ========================= C EXECUTABLE TARGET  =========================

C_EXEC_6_NAME		= cvector
C_EXEC_6_SOURCES	= cvector.c
C_EXEC_6_OBJECTS	= cvector.o
C_EXEC_6_LIBRARIES	= -lpil ${LAST_LIBS}

${C_EXEC_6_NAME}:	${C_EXEC_6_OBJECTS} ${LIB_FULL_NAME}
			${CC} ${ALL_C_CFLAGS} -o $@ $^ ${ALL_C_LDFLAGS} ${C_EXEC_6_LIBRARIES}

CLEAN_TARGETS		+= ${C_EXEC_6_NAME} ${C_EXEC_6_OBJECTS}
ALL_TARGETS		+= ${C_EXEC_6_NAME}

# ======================== F90 EXECUTABLE TARGET  ========================

F90_EXEC_1_NAME		= pilfdemo
F90_EXEC_1_SOURCES	= pilfdemo.f90
F90_EXEC_1_OBJECTS	= pilfdemo.o
F90_EXEC_1_LIBRARIES	= -lpil ${LAST_LIBS}

${F90_EXEC_1_NAME}:	${F90_EXEC_1_OBJECTS} ${LIB_FULL_NAME}
			${F90} ${ALL_F90_CFLAGS} -o $@ $^ ${ALL_F90_LDFLAGS} ${F90_EXEC_1_LIBRARIES}

CLEAN_F90_TARGETS	+= ${F90_EXEC_1_NAME} ${F90_EXEC_1_OBJECTS}
ALL_F90_TARGETS		+= ${F90_EXEC_1_NAME}

# ========================================================================

testcommands::
			( cd unit_test && README.test )

# ========================================================================
