packages: fix parallel build by adding + for every make command that passes the jobserver
[openwrt/svn-archive/archive.git] / lang / python-sip / Makefile
1 #
2 # Copyright (C) 2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=python-sip
11 PKG_VERSION:=4.12.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=sip-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://bu3sch.de/pyqt4/
16 PKG_MD5SUM:=0f8e8305b14c1812191de2e0ee22fea9
17 PKG_INSTALL:=1
18 PKG_BUILD_PARALLEL:=1
19 HOST_BUILD_PARALLEL:=1
20 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/sip-$(PKG_VERSION)
21 PKG_BUILD_DIR:=$(BUILD_DIR)/sip-$(PKG_VERSION)
22
23 PKG_BUILD_DEPENDS:=python
24 HOST_BUILD_DEPENDS:=python
25
26 include $(INCLUDE_DIR)/host-build.mk
27 include $(INCLUDE_DIR)/package.mk
28 $(call include_mk, python-package.mk)
29 -include $(if $(DUMP),,./files/python-sip-package.mk)
30
31 define Package/python-sip
32 SECTION:=devel
33 CATEGORY:=Development
34 TITLE:=Python SIP
35 DEPENDS:=+python
36 MAINTAINER:=Michael Buesch <mb@bu3sch.de>
37 URL:=http://www.riverbankcomputing.co.uk/software/sip/download
38 endef
39
40
41 # ===> TARGET <===
42
43 EXTRA_CFLAGS:=\
44 $(FPIC)
45
46 define Build/Configure
47 $(INSTALL_DIR) "$(PYTHON_SIP_CONFIG_TEMPLATE_DIR)"
48 $(CP) ./files/sipconfig.macros.template "$(PYTHON_SIP_CONFIG_TEMPLATE)"
49 echo "CC $(TARGET_CROSS)gcc" >> $(PYTHON_SIP_CONFIG_TEMPLATE)
50 echo "CFLAGS $(TARGET_CFLAGS) $(EXTRA_CFLAGS)" >> $(PYTHON_SIP_CONFIG_TEMPLATE)
51 echo "CXX $(TARGET_CROSS)g++" >> $(PYTHON_SIP_CONFIG_TEMPLATE)
52 echo "CXXFLAGS $(TARGET_CFLAGS) $(EXTRA_CFLAGS)" >> $(PYTHON_SIP_CONFIG_TEMPLATE)
53 echo "LINK $(TARGET_CROSS)g++" >> $(PYTHON_SIP_CONFIG_TEMPLATE)
54 echo "LINK_SHLIB $(TARGET_CROSS)g++" >> $(PYTHON_SIP_CONFIG_TEMPLATE)
55 echo "LFLAGS $(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" >> $(PYTHON_SIP_CONFIG_TEMPLATE)
56 echo "AR $(TARGET_CROSS)ar cqs" >> $(PYTHON_SIP_CONFIG_TEMPLATE)
57 echo "STRIP $(STRIP)" >> $(PYTHON_SIP_CONFIG_TEMPLATE)
58 $(call HostPython, \
59 cd "$(PKG_BUILD_DIR)"; \
60 , \
61 ./configure.py \
62 --crosscompile \
63 --bindir=$(PKG_INSTALL_DIR)/usr/bin \
64 --destdir=$(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR) \
65 --incdir=$(PKG_INSTALL_DIR)/usr/include \
66 --sipdir=$(PKG_INSTALL_DIR)/usr/share/sip \
67 --sipconfig-macros="$(PYTHON_SIP_CONFIG_TEMPLATE)" \
68 --py-site-dir=$(STAGING_DIR)/$(PYTHON_PKG_DIR) \
69 --py-inc-dir=$(PYTHON_INC_DIR) \
70 --py-conf-inc-dir=$(PKG_BUILD_DIR) \
71 --py-lib-dir=$(PYTHON_LIB_DIR) \
72 --py-bin-dir=$(PYTHON_BIN_DIR) \
73 --py-sip-dir=$(STAGING_DIR)/usr/share/sip \
74 )
75 endef
76
77 define Build/Compile
78 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
79 CC="$(TARGET_CROSS)gcc" \
80 CXX="$(TARGET_CROSS)g++" \
81 LINK="$(TARGET_CROSS)g++" \
82 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
83 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)"
84 endef
85
86 define Build/InstallDev
87 $(INSTALL_DIR) $(1)/mk $(1)/$(PYTHON_PKG_DIR)
88 $(INSTALL_DATA) ./files/python-sip-package.mk $(1)/mk/
89 $(CP) $(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)/* $(1)/$(PYTHON_PKG_DIR)
90 endef
91
92 define Build/Install
93 $(MAKE) -C $(PKG_BUILD_DIR) \
94 CC="$(TARGET_CROSS)gcc" \
95 CXX="$(TARGET_CROSS)g++" \
96 LINK="$(TARGET_CROSS)g++" \
97 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
98 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
99 DESTDIR="" \
100 install
101 endef
102
103 define Package/python-sip/install
104 # We only install the python module for now...
105 $(INSTALL_DIR) $(1)/$(PYTHON_PKG_DIR)
106 $(CP) $(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)/* $(1)/$(PYTHON_PKG_DIR)
107 endef
108
109
110 # ===> HOST <===
111
112 HOST_CFLAGS+= \
113 $(HOST_FPIC) \
114 -I$(STAGING_DIR_HOST)/include/python$(PYTHON_VERSION)
115
116 define Host/Configure
117 $(call HostPython, \
118 cd "$(HOST_BUILD_DIR)"; \
119 , \
120 ./configure.py \
121 --bindir=$(STAGING_DIR_HOST)/usr/bin \
122 --destdir=$(STAGING_DIR_HOST)/$(PYTHON_PKG_DIR) \
123 --incdir=$(STAGING_DIR_HOST)/usr/include \
124 --sipdir=$(STAGING_DIR_HOST)/usr/share/sip \
125 )
126 endef
127
128 define Host/Compile
129 $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
130 CC="$(HOSTCC)" \
131 CXX="g++" \
132 LINK="g++" \
133 CFLAGS="$(HOST_CFLAGS)" \
134 CXXFLAGS="$(HOST_CFLAGS)"
135 endef
136
137 define Host/Install
138 $(MAKE) -C $(HOST_BUILD_DIR) \
139 CC="$(HOSTCC)" \
140 CXX="g++" \
141 LINK="g++" \
142 CFLAGS="$(HOST_CFLAGS)" \
143 CXXFLAGS="$(HOST_CFLAGS)" \
144 install
145 endef
146
147 $(eval $(call HostBuild))
148 $(eval $(call BuildPackage,python-sip))