###################### VARIABLES ##########################
# Compiler
CC=g++
CFLAGS=-I /opt/glite/include

# Linker
LD=g++
GLOBUS_FLAVOR_THREADS=gcc32dbg
LFLAGS=-L$(GLITE_LOCATION)/lib -lglite_data_io_client \
       -L$(GLOBUS_LOCATION)/lib \
	-lglobus_gsi_proxy_core_$(GLOBUS_FLAVOR_THREADS) \
	-lglobus_gsi_credential_$(GLOBUS_FLAVOR_THREADS) \
	-lglobus_gsi_callback_$(GLOBUS_FLAVOR_THREADS) \
	-lglobus_oldgaa_$(GLOBUS_FLAVOR_THREADS) \
	-lglobus_gsi_sysconfig_$(GLOBUS_FLAVOR_THREADS) \
	-lglobus_gsi_cert_utils_$(GLOBUS_FLAVOR_THREADS) \
	-lglobus_openssl_$(GLOBUS_FLAVOR_THREADS) \
	-lglobus_proxy_ssl_$(GLOBUS_FLAVOR_THREADS) \
	-lglobus_openssl_error_$(GLOBUS_FLAVOR_THREADS) \
	-lglobus_ftp_client_$(GLOBUS_FLAVOR_THREADS) \
	-lssl_$(GLOBUS_FLAVOR_THREADS) \
	-lcrypto_$(GLOBUS_FLAVOR_THREADS) \
	-lglobus_gss_assist_$(GLOBUS_FLAVOR_THREADS) \
	-lglobus_gssapi_gsi_$(GLOBUS_FLAVOR_THREADS) \
	-lglobus_common_$(GLOBUS_FLAVOR_THREADS)

# Default program to compile (use "make PROGRAM=your_name" to override)
PROGRAM=fibonacciGlite-io
SOURCES=$(PROGRAM).cpp
OBJECTS=$(PROGRAM).o


####################### TARGETS ###########################
# Default
all: LINK $(SOURCES)

# Linking...
LINK: $(OBJECTS) $(SOURCES)
	$(LD) $(CFLAGS) -o $(PROGRAM) $(LFLAGS) $<

# Compiling...
%.o: %.cpp
	$(CC) -c $(CFLAGS) $<

clean:
	rm $(PROGRAM) $(OBJECTS)
