summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-12-17 17:59:25 -0800
committerThiago Macieira <thiago.macieira@intel.com>2012-12-19 09:02:28 +0100
commit58b7e16dbf62f49e247ec73e0a4d82e16d8d38b1 (patch)
treedb616d8d95d42bd301da867f279595b099f4a327
parent376a28e542212800eb6925240a5c1191f0e7ac9d (diff)
Make make {install,clean,distclean,uninstall} work
Change-Id: Iae7f50ee99efe39acca3e5221f50441e90d0d657 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r--Makefile48
-rw-r--r--src/qtchooser/Makefile11
2 files changed, 57 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 8654809..7f8eaf4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,57 @@
+prefix = /usr
+bindir = $(prefix)/bin
+TOOLS = assistant \
+ designer \
+ lconvert \
+ linguist \
+ lrelease \
+ lupdate \
+ moc \
+ pixeltool \
+ qcollectiongenerator \
+ qdbus \
+ qdbuscpp2xml \
+ qdbusviewer \
+ qdbusxml2cpp \
+ qglinfo \
+ qhelpconverter \
+ qhelpgenerator \
+ qmake \
+ qml1plugindump \
+ qmlbundle \
+ qmlmin \
+ qmlplugindump \
+ qmlprofiler \
+ qmlscene \
+ qmltestrunner \
+ qmlviewer \
+ qtconfig \
+ rcc \
+ uic \
+ uic3 \
+ xmlpatterns \
+ xmlpatternsvalidator \
+
+# keep the above line empty
+
all:
cd src/qtchooser && $(MAKE)
+clean:
+ -cd src/qtchooser && $(MAKE) clean
+ -cd tests/auto && $(MAKE) clean
+
+distclean:
+ -cd src/qtchooser && $(MAKE) distclean
+ -cd tests/auto && $(MAKE) distclean
+
install:
cd src/qtchooser && $(MAKE) install
+ for tool in $(TOOLS); do ln -sf qtchooser "$(INSTALL_ROOT)$(bindir)/$$tool"; done
uninstall:
cd src/qtchooser && $(MAKE) uninstall
+ -for tool in $(TOOLS); do rm -f "$(INSTALL_ROOT)$(bindir)/$$tool"; done
tests/auto/Makefile: tests/auto/auto.pro
cd tests/auto && qmake -o Makefile auto.pro
@@ -14,4 +60,4 @@ check: tests/auto/Makefile
cd src/qtchooser && $(MAKE) check
cd tests/auto && $(MAKE) check
-.PHONY: all install uninstall check
+.PHONY: all install uninstall check clean distclean
diff --git a/src/qtchooser/Makefile b/src/qtchooser/Makefile
index 974474a..7e1598f 100644
--- a/src/qtchooser/Makefile
+++ b/src/qtchooser/Makefile
@@ -1,3 +1,6 @@
+prefix = /usr
+bindir = $(prefix)/bin
+
####### Compiler, tools and options
INSTALL_PROGRAM = install -m 755 -p
@@ -33,7 +36,13 @@ clean:
distclean: clean
-$(DEL_FILE) $(TARGET) $(TARGET_TEST)
- -$(DEL_FILE) Makefile
+
+install: $(TARGET)
+ $(MKDIR) "$(INSTALL_ROOT)$(bindir)"
+ $(INSTALL_PROGRAM) $(TARGET) "$(INSTALL_ROOT)$(bindir)/$(TARGET)"
+
+uninstall:
+ -$(DEL_FILE) "$(INSTALL_ROOT)$(bindir)/$(TARGET)"
####### Compile