# # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. # # # Rules and Macros for building open source software that builds with # ninja (whether using a provided ninja file or one generated by a tool # such as meson). # # To use these rules on their own, set BUILD_STYLE=ninja before including # $(WS_MAKE_RULES)/common.mk. They will also be used for the build rules # if you set BUILD_STYLE=meson. # # Any additional pre/post configure, build, or install actions can be specified # in your Makefile by setting them in on of the following macros: # COMPONENT_PRE_BUILD_ACTION, COMPONENT_BUILD_ACTION, # COMPONENT_POST_BUILD_ACTION, COMPONENT_PRE_INSTALL_ACTION, # COMPONENT_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION # # If component specific ninja targets need to be used for build or install, they # can be specified in # COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS # NINJA = /usr/bin/ninja USERLAND_REQUIRED_PACKAGES += developer/build/ninja # Configure COMPONENT_CONFIGURE_ACTION ?= true # Build COMPONENT_BUILD_CMD = $(NINJA) -C $(@D) # Install COMPONENT_INSTALL_CMD = $(NINJA) -C $(@D) COMPONENT_INSTALL_ENV += DESTDIR=$(PROTO_DIR) # Test COMPONENT_TEST_CMD = $(NINJA) COMPONENT_TEST_TARGETS = test # Cleanup clean:: $(RM) -r $(BUILD_DIR) $(PROTO_DIR) # Use common rules USE_COMMON_RULES = yes