
# To modify this Makefile, edit Makefile_default.tpl file in ~/.skel/templates/
# and run skel makefile  

include /ccs/proj/e2e/pnorbert/ADIOS/sith.pgi/bin/../etc/skel/compiler_fragment.mk

ADIOS_DIR=/ccs/proj/e2e/pnorbert/ADIOS/sith.pgi
LDFLAGS += `${ADIOS_DIR}/bin/adios_config -l`
CFLAGS += `${ADIOS_DIR}/bin/adios_config -c`
FCFLAGS += `${ADIOS_DIR}/bin/adios_config -fc`          
FCLIBS += `${ADIOS_DIR}/bin/adios_config -fl` -L${ADIOS_DIR}/lib/skel -lskel
               
APP=picongpu
CTESTS=picongpu_skel_fields_write 
FTESTS=

DEST_DIR=~/skel-deploy-dir/$(APP)/128

all: $(FTESTS) $(CTESTS)


$(CTESTS): $(CTESTS:=.c)
	$(CC) $(CFLAGS) -o $@ ${@}.c $(LDFLAGS)

$(FTESTS): $(FTESTS:=.f90)
	$(FC) $(FCFLAGS) -o $@ ${@}.f90 $(FCLIBS)


deploy:
	#Make sure this exists
	mkdir -p $(DEST_DIR)

	rm -f $(DEST_DIR)/submit*
	cp $(APP)_skel.xml $(DEST_DIR)/$(APP)_skel.xml.in
	cp $(CTESTS) submit* $(DEST_DIR)
	cp $(FTESTS) submit* $(DEST_DIR)
	cp $(prefix)/bin/set_method.sh $(DEST_DIR)
	cp $(prefix)/bin/skel_cat.py $(DEST_DIR)

clean:
	rm -f *.c
	rm -f *.f90
	#rm -f submit*
	rm -f $(CTESTS) $(FTESTS)


