make-rules/prep.mk
changeset 59 7500d63edb42
parent 42 566ce4d2ff99
child 115 c360825c3a3f
equal deleted inserted replaced
58:d8024c042a00 59:7500d63edb42
    16 # fields enclosed by brackets "[]" replaced with your own identifying
    16 # fields enclosed by brackets "[]" replaced with your own identifying
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
    18 #
    18 #
    19 # CDDL HEADER END
    19 # CDDL HEADER END
    20 #
    20 #
    21 # Copyright (c) 2010, Oracle and/or it's affiliates.  All rights reserved.
    21 # Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
    22 #
    22 #
    23 
    23 
    24 UNPACK =	$(WS_TOOLS)/userland-unpack
    24 UNPACK =	$(WS_TOOLS)/userland-unpack
    25 FETCH =		$(WS_TOOLS)/userland-fetch
    25 FETCH =		$(WS_TOOLS)/userland-fetch
    26 
    26 
    27 ARCHIVES += $(COMPONENT_ARCHIVE)
    27 ARCHIVES += $(COMPONENT_ARCHIVE)
    28 CLEAN_PATHS += $(COMPONENT_SRC)
    28 CLEAN_PATHS += $(SOURCE_DIR)
    29 CLOBBER_PATHS += $(COMPONENT_ARCHIVE)
    29 CLOBBER_PATHS += $(COMPONENT_ARCHIVE)
    30 
    30 
    31 PATCHES =	$(shell find . -type f -name '*.patch' | \
    31 PATCHES =	$(shell find . -type f -name '*.patch' | \
    32 			 sed -e 's;^\./;;' | grep -v $(COMPONENT_SRC) | sort)
    32 			 sed -e 's;^\./;;' | grep -v $(SOURCE_DIR) | sort)
    33 STAMPS =	$(PATCHES:%=$(COMPONENT_SRC)/.%ed)
    33 STAMPS =	$(PATCHES:%=$(SOURCE_DIR)/.%ed)
    34 
    34 
    35 $(COMPONENT_SRC)/.%ed:	%
    35 $(SOURCE_DIR)/.%ed:	%
    36 	$(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $<
    36 	$(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $<
    37 	$(TOUCH) [email protected]
    37 	$(TOUCH) [email protected]
    38 
    38 
    39 $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE):	Makefile
    39 $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE):	Makefile
    40 	$(FETCH) --file [email protected] \
    40 	$(FETCH) --file [email protected] \
    41 		$(COMPONENT_ARCHIVE_URL:%=--url %) \
    41 		$(COMPONENT_ARCHIVE_URL:%=--url %) \
    42 		$(COMPONENT_ARCHIVE_HASH:%=--hash %)
    42 		$(COMPONENT_ARCHIVE_HASH:%=--hash %)
    43 	$(TOUCH) [email protected]
    43 	$(TOUCH) [email protected]
    44 
    44 
    45 $(COMPONENT_SRC)/.unpacked:	$(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE) Makefile $(PATCHES)
    45 $(SOURCE_DIR)/.unpacked:	$(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE) Makefile $(PATCHES)
    46 	$(RM) -r $(COMPONENT_SRC)
    46 	$(RM) -r $(SOURCE_DIR)
    47 	$(UNPACK) $(UNPACK_ARGS) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE)
    47 	$(UNPACK) $(UNPACK_ARGS) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE)
    48 	$(TOUCH) [email protected]
    48 	$(TOUCH) [email protected]
    49 
    49 
    50 $(COMPONENT_SRC)/.patched:	$(COMPONENT_SRC)/.unpacked $(STAMPS)
    50 $(SOURCE_DIR)/.patched:	$(SOURCE_DIR)/.unpacked $(STAMPS)
    51 	$(TOUCH) [email protected]
    51 	$(TOUCH) [email protected]
    52 
    52 
    53 $(COMPONENT_SRC)/.prep:	$(COMPONENT_SRC)/.patched
    53 $(SOURCE_DIR)/.prep:	$(SOURCE_DIR)/.patched
    54 	$(COMPONENT_PREP_ACTION)
    54 	$(COMPONENT_PREP_ACTION)
    55 	$(TOUCH) [email protected]
    55 	$(TOUCH) [email protected]
    56 
    56 
    57 prep::	$(COMPONENT_SRC)/.prep
    57 prep::	$(SOURCE_DIR)/.prep
    58 
    58 
    59 download::	$(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE)
    59 download::	$(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE)
    60 
    60 
    61 clean::
    61 clean::
    62 	$(RM) -r $(CLEAN_PATHS)
    62 	$(RM) -r $(CLEAN_PATHS)