.PHONY: copy install clean prereq order new_version

include Makefile.vars


# list of applications that are part of the release
PACKAGES=

# recreate all applications as necessary
copy::	prereq checkdir order
	@for i in $(PACKAGES) ; do $(MAKE) -C $$i copy || exit 1 ; done

clean:: 
	@for i in $(PACKAGES) $(IGNORE) ; do $(MAKE) -C $$i clean || exit 1 ; done
	rm -rf $(BUILD_DIR)

release:: 
	@for i in $(PACKAGES) ; do $(MAKE) -C $$i release || exit 1 ; done

prereq::
ifeq "$(IDENTICAL_PACKAGES)" "yes"
	@if ! id -nu | fgrep root > /dev/null ; then echo "You need to be root to install this package!"; exit 1 ; fi
endif

checkdir::
	@if [ ! -d $(MIDORI) -o ! -d $(MIDORI)/apps ] ; then echo "cannot find your midori linux tree at $(MIDORI)" ; exit 1 ; fi
	@if [ ! -d $(APPS_DIRECTORY) ] ; then echo "cannot find your apps directory $(APPS_DIRECTORY)" ; exit 1 ; fi

