clang-40: use -j4 on jeffpc's dev box
[unleashed-userland.git] / components / developer / clang-40 / Makefile
blobaf72b876f9538c95adfd32ebe509d27a1e261f1b
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2016 Aurelien Larcher. All rights reserved.
16 include ../../../make-rules/shared-macros.mk
18 COMPONENT_NAME= clang-40
19 LLVM_NAME=llvm
20 CLANG_NAME=cfe
22 COMPONENT_VERSION= 4.0.1
23 COMPONENT_MAJOR_VERSION= \
24 $(shell echo $(COMPONENT_VERSION) | sed -e 's/\([0-9]\{1,\}\.[0-9]\{1,\}\).*/\1/')
25 COMPONENT_PROJECT_URL = http://llvm.org/
26 COMPONENT_FMRI= developer/clang-40
27 COMPONENT_CLASSIFICATION= Development/C
28 COMPONENT_SUMMARY= LLVM tools and Clang compiler
29 COMPONENT_SRC= $(LLVM_NAME)-$(COMPONENT_VERSION).src
30 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
31 COMPONENT_ARCHIVE_HASH= \
32 sha256:da783db1f82d516791179fe103c71706046561f7972b18f0049242dee6712b51
33 COMPONENT_ARCHIVE_URL= \
34 http://llvm.org/releases/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
35 COMPONENT_LICENSE= BSD
37 COMPONENT_ARCHIVE_1= $(CLANG_NAME)-$(COMPONENT_VERSION).src.tar.xz
38 COMPONENT_ARCHIVE_HASH_1= \
39 sha256:61738a735852c23c3bdbe52d035488cdb2083013f384d67c1ba36fabebd8769b
40 COMPONENT_ARCHIVE_URL_1= http://llvm.org/releases/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE_1)
42 COMPONENT_BUILD_GMAKE_ARGS= -j4
44 include $(WS_MAKE_RULES)/prep.mk
45 include $(WS_MAKE_RULES)/cmake.mk
46 include $(WS_MAKE_RULES)/ips.mk
47 -include .local-$(HOSTNAME).mk
49 CMAKE_PREFIX= /usr/clang/$(COMPONENT_MAJOR_VERSION)
51 COMPONENT_POST_UNPACK_ACTION += \
52 $(UNPACK) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE_1) && \
53 mv $(CLANG_NAME)-$(COMPONENT_VERSION).src $(COMPONENT_SRC)/tools/clang
55 COMPONENT_PRE_CONFIGURE_ACTION = (cp -a $(SOURCE_DIR)/* $(@D))
57 COMPONENT_POST_INSTALL_ACTION = \
58 for file in `echo $(PROTO_DIR)/$(CMAKE_PREFIX)/bin/*`; do \
59 elfedit -e 'dyn:runpath $$ORIGIN/../lib' $$file ; \
60 done && \
61 for file in `echo $(PROTO_DIR)/$(CMAKE_PREFIX)/lib/*.so`; do \
62 elfedit -e 'dyn:delete RUNPATH' $$file ; \
63 elfedit -e 'dyn:delete RPATH' $$file ; \
64 done && \
65 for file in \
66 `ggrep -rlh '^\#!*/usr/bin/env python' $(PROTO_DIR)/$(CMAKE_PREFIX)`; do \
67 sed -i -e 's,^\#!*/usr/bin/env python,\#!$(PYTHON),' $$file; \
68 done
70 COMPONENT_TEST_TARGETS = check-all
71 COMPONENT_TEST_ENV += PATH=/usr/gnu/bin:/usr/bin
73 CMAKE_OPTIONS += -DCMAKE_C_COMPILER=$(CC)
74 CMAKE_OPTIONS += -DCMAKE_CXX_COMPILER=$(CXX)
75 CMAKE_OPTIONS += -DGCC_INSTALL_PREFIX=$(GCC_ROOT)
76 CMAKE_OPTIONS += -DCMAKE_CXX_LINK_FLAGS="-L$(GCC_ROOT)/lib -Wl,-rpath,$(GCC_ROOT)/lib"
77 CMAKE_OPTIONS += -DLLVM_ENABLE_ASSERTIONS=ON
78 CMAKE_OPTIONS += -DCMAKE_BUILD_TYPE="Release"
81 build: $(BUILD_32)
83 install: $(INSTALL_32)
85 test: $(TEST_32)
87 # Auto-generated dependencies
88 REQUIRED_PACKAGES += library/libxml2
89 REQUIRED_PACKAGES += library/zlib
90 REQUIRED_PACKAGES += runtime/python-27
91 REQUIRED_PACKAGES += system/library
92 REQUIRED_PACKAGES += system/library/g++-4-runtime
93 REQUIRED_PACKAGES += system/library/gcc-4-runtime
94 REQUIRED_PACKAGES += system/library/math