include ../Make.inc
include ../Make.rules

ifneq ($(MAKECMDGOALS),clean)
ifneq (,$(USE_GLOBUS_GPT))
-include globus_makefile.mk
else
include globus_makefile.mk.pre
endif
endif

INSTALL_BASE=${NORDUGRID_LOCATION}
LIBS=-L${GLOBUS_LIBS} ${GLOBUS_DATAMOVE_LIBS} -lpthread
CPPLIBS=-lstdc++
INCLUDES=-I${GLOBUS_INCLUDES}
PROGRAMS=
OTHER_OBJECTS=
CLIENT_PROGRAMS=
LIBRARIES=
STATIC_LIBRARIES=
CFLAGS=-g -O0 -ansi

all: ${PROGRAMS} ${LIBRARIES}

globus_makefile.mk:
	@export GLOBUS_LOCATION=$(GLOBUS_LOCATION) ; \
	${USE_GLOBUS_GPT} \
	-flavor=${GLOBUS_FLAVOR} globus_ftp_client globus_replica_catalog globus_gass_transfer globus_gass_copy $(GLOBUS_RLS_OBJECT) | \
	grep '^GLOBUS_PKG_LIBS' | sed 's/^GLOBUS_PKG_LIBS/GLOBUS_DATAMOVE_LIBS/' \
	>globus_makefile.mk ; \
	RESULT=$$? ; \
	if [ $$RESULT -ne 0 ] ; then rm -f globus_makefile.mk ; fi ; \
	exit $$RESULT

client: ${CLIENT_PROGRAMS} ${LIBRARIES}

client-static: ${CLIENT_PROGRAMS} ${STATIC_LIBRARIES}

clean:
	@rm -f ${PROGRAMS} ${LIBRARIES} ${OBJECTS} *.o

install: ${PROGRAMS} ${LIBRARIES}
	@echo "Actual installation is performed in base directory"

install-client: ${CLIENT_PROGRAMS} ${LIBRARIES}
	@echo "Actual installation is performed in base directory"
