#
# Pablo System: Visual/AppDefaults/Makefile
#
TOP := ../..

override MAKEFLAGS += --no-builtin-rules    # cancel predefined pattern rules
.SUFFIXES:

.PHONY : Makefile $(TOP)/Makefile.defines   # explicitly mark PHONY to save time
include $(TOP)/Makefile.defines		    # Pablo configuration parameters

RESOURCEFILES = Pablo 

#
# Default target: all
#	The appdefaults file is called "Pablo".  We say it's a PHONY target
#	even though it's a real file so that it gets remade every time.
#
.PHONY : Pablo all install clean

all: 	Pablo

Pablo: 
	$(CPP_CMD) -IResourceFiles Pablo.template Pablo.ressrc
	-cp Pablo Pablo.bak
	cat WarningMsg Pablo.ressrc > $@

install: 
	$(CPP_CMD) -IResourceFiles Pablo.template Pablo.ressrc
	cat WarningMsg Pablo.ressrc > Pablo.install; chmod 664 Pablo.install
	updateResource Pablo.defaultHelpFileDir $(PABLOHELPDIR)
	updateResource Pablo.defaultDataFileDir $(PABLODATAFILES)
	updateResource Pablo.defaultConfigFileDir $(PABLOCONFIGDIR)
	cp Pablo.install Pablo

	$(MAKEDIRHIER) $(PABLOAPPDEFAULTS)
	for f in $(RESOURCEFILES); do \
	    install -c -m 644 $$f $(PABLOAPPDEFAULTS); \
	done

	cat WarningMsg Pablo.ressrc > Pablo

ifeq ($(strip $(USE_AUDIO)),yes)
	cp -r Sound $(PABLOAPPDEFAULTS)
endif

clean:
	rm -f Pablo.bak Pablo.ressrc Pablo.install Pablo.install.bak
