# Copyright (c) 2009-2011 Centro Svizzero di Calcolo Scientifico (CSCS)
# Licensed under the GPLv2.
RM = rm -f

DISTNAME= basil_parser_CSCS
TARBALL	= $(DISTNAME).tar.gz

SUBDIRS = ../libalps ../libsdb
SUBDIRS += query_alps_engine	\
	   get_free_nodes 	\
	   sched_inventory	\
	   test_reservation	\
	   cancel_reservation	\
	   parse_nodelist

# lesser used, for testing
SUBDIRS += mpp_inventory reassemble_inventory topology_from_inventory

help:
	@echo >&2 "usage: $(MAKE) all|clean|tar"

clean all:
	@for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@||exit 1; done
	@$(RM) $(TARBALL)

$(TARBALL): clean
	tar zcvf $@ --transform=s@^@$(DISTNAME)_$(shell date +%F)/@\
		    --exclude=RCS \
		    $(SUBDIRS) ../include Makefile

tar: $(TARBALL)
	ls -lh $<
