genode/qt4/Makefile

79 lines
2.2 KiB
Makefile
Raw Normal View History

2011-12-22 15:19:25 +00:00
#
# \brief Download and prepare Qt4 source code
# \author Christian Prochaska
# \author Norman Feske
# \date 2009-05-11
#
VERBOSE ?= @
ECHO = @echo
DOWNLOAD_DIR = download
CONTRIB_DIR = contrib
2013-05-02 15:59:56 +00:00
PATCHES_DIR = src/lib/qt4/patches
2011-12-22 15:19:25 +00:00
REP_DIR := $(realpath .)
include $(REP_DIR)/lib/mk/qt_version.inc
2013-05-02 15:59:56 +00:00
QT4_URL = http://releases.qt-project.org/qt4/source
2011-12-22 15:19:25 +00:00
QT4_TGZ = $(QT4).tar.gz
QTSCRIPTCLASSIC_URL = http://ftp.heanet.ie/mirrors/ftp.trolltech.com/pub/qt/solutions/lgpl
2011-12-22 15:19:25 +00:00
QTSCRIPTCLASSIC = qtscriptclassic-1.0_1-opensource
QTSCRIPTCLASSIC_TGZ = $(QTSCRIPTCLASSIC).tar.gz
2013-05-02 15:59:56 +00:00
PATCHES = $(shell cat $(PATCHES_DIR)/series)
2011-12-22 15:19:25 +00:00
#
# Utility to check if a tool is installed
#
check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.))
$(call check_tool,wget)
$(call check_tool,patch)
2011-12-22 15:19:25 +00:00
help:
$(ECHO)
$(ECHO) "Prepare the Qt4 repository"
$(ECHO)
$(ECHO) "--- available commands ---"
$(ECHO) "prepare - download and extract the Qt4 source code archive and build the host tools"
$(ECHO) "clean - clean everything except downloaded archives"
$(ECHO) "cleanall - clean everything including downloaded archives"
$(ECHO)
prepare: $(CONTRIB_DIR)/$(QT4) $(CONTRIB_DIR)/$(QTSCRIPTCLASSIC) tools
$(CONTRIB_DIR)/$(QT4): $(CONTRIB_DIR) $(DOWNLOAD_DIR)/$(QT4_TGZ)
$(VERBOSE)tar xzf $(DOWNLOAD_DIR)/$(QT4_TGZ) -C $(CONTRIB_DIR)
$(VERBOSE)touch $(CONTRIB_DIR)/$(QT4)
$(VERBOSE)for p in $(PATCHES); do \
2013-05-02 15:59:56 +00:00
patch -d $(CONTRIB_DIR)/$(QT4) -p1 -i ../../$(PATCHES_DIR)/$$p; done
2011-12-22 15:19:25 +00:00
$(CONTRIB_DIR)/$(QTSCRIPTCLASSIC): $(CONTRIB_DIR) $(DOWNLOAD_DIR)/$(QTSCRIPTCLASSIC_TGZ)
$(VERBOSE)tar xzf $(DOWNLOAD_DIR)/$(QTSCRIPTCLASSIC_TGZ) -C $(CONTRIB_DIR)
$(VERBOSE)touch $(CONTRIB_DIR)/$(QTSCRIPTCLASSIC)
$(CONTRIB_DIR):
$(VERBOSE)mkdir -p $(CONTRIB_DIR)
$(DOWNLOAD_DIR)/$(QT4_TGZ): $(DOWNLOAD_DIR)
$(VERBOSE)wget -c -P $(DOWNLOAD_DIR) $(QT4_URL)/$(QT4_TGZ) && touch $@
$(DOWNLOAD_DIR)/$(QTSCRIPTCLASSIC_TGZ): $(DOWNLOAD_DIR)
$(VERBOSE)wget -c -P $(DOWNLOAD_DIR) $(QTSCRIPTCLASSIC_URL)/$(QTSCRIPTCLASSIC_TGZ) && touch $@
$(DOWNLOAD_DIR):
$(VERBOSE)mkdir -p $(DOWNLOAD_DIR)
tools:
$(VERBOSE)make -C tool
clean:
$(VERBOSE)make -C tool clean
$(VERBOSE)rm -rf $(CONTRIB_DIR)
cleanall: clean
$(VERBOSE)make -C tool distclean
$(VERBOSE)rm -rf $(DOWNLOAD_DIR)