
### export UPPOUT = out/
# EBo -- try explicit paths
export UPPOUT = $(shell pwd)/out/
export OutFile = $(UPPOUT)ide/GCC-Gcc-Gui-Linux-Main-Shared/ide

# EBo -- Allow admins to set the destination directory to something
# more reasonable (like "/usr/local/*" instead of "/usr/local/usr/*"
# which is used to do.  "/usr" may be preferred.
ifeq ($(DESTDIR),)
  DESTDIR = /usr/local
endif

.PHONY: theide
theide: 
	$(MAKE) -f uppsrc/ide/Makefile	

# EBo -- making theide separate from install will allow users to
# build and test without root access.
.PHONY: all
all:	theide # install clean

#	EBo -- install (-D) will create the appropriate parent directories 
#
#	mkdir -p $(DESTDIR)/bin
#	mkdir -p $(DESTDIR)/share/applications
#	mkdir -p $(DESTDIR)/share/pixmaps
#	mkdir -p $(DESTDIR)/share/upp
.PHONY: install
install:
	install -D $(OutFile) $(DESTDIR)/bin/theide
	install -D uppsrc/ide/theide.desktop $(DESTDIR)/share/applications/theide.desktop
	install -D uppsrc/ide/theide-48.png $(DESTDIR)/share/pixmaps/theide.png
	install -D uppsrc/ide/GCC.bm $(DESTDIR)/share/upp
	cp -r Common    $(DESTDIR)/share/upp
	cp -r uppsrc    $(DESTDIR)/share/upp
	cp -r examples  $(DESTDIR)/share/upp
	cp -r reference $(DESTDIR)/share/upp
	cp -r tutorial  $(DESTDIR)/share/upp

.PHONY: clean
clean:
	${RM} -r $(UPPOUT)

# Remove all public traces...
uninstall:
	${RM}    $(DESTDIR)/bin/theide
	${RM}    $(DESTDIR)/share/applications/theide.desktop
	${RM}    $(DESTDIR)/share/pixmaps/theide.png
	${RM} -r $(DESTDIR)/share/upp

