Last Comment Bug 773202 - Generic install/copy rule
: Generic install/copy rule
Status: RESOLVED FIXED
[buildfaster:?]
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla17
Assigned To: Mike Hommey [:glandium]
:
Mentors:
Depends on: 770426 790737
Blocks: 881368 784262
  Show dependency treegraph
 
Reported: 2012-07-12 02:57 PDT by Mike Hommey [:glandium]
Modified: 2013-06-10 11:27 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Generic install/copy rule (3.41 KB, patch)
2012-07-12 03:13 PDT, Mike Hommey [:glandium]
ted: review-
Details | Diff | Review
Generic install/copy rule (6.17 KB, patch)
2012-07-23 23:53 PDT, Mike Hommey [:glandium]
ted: review+
Details | Diff | Review

Description Mike Hommey [:glandium] 2012-07-12 02:57:51 PDT

    
Comment 1 Mike Hommey [:glandium] 2012-07-12 03:13:33 PDT
Created attachment 641415 [details] [diff] [review]
Generic install/copy rule
Comment 2 Ted Mielczarek [:ted.mielczarek] 2012-07-20 11:14:26 PDT
Comment on attachment 641415 [details] [diff] [review]
Generic install/copy rule

Review of attachment 641415 [details] [diff] [review]:
-----------------------------------------------------------------

::: config/rules.mk
@@ +1688,5 @@
> +# and whether the files are executables or not.
> +#
> +# FOO_FILES := foo bar
> +# FOO_DEST := target_path
> +# FOO_EXECUTABLES := 1

Having to say "FOO_EXECUTABLES := 1" is a bit awkward. I think it'd be nicer if FOO_EXECUTABLES was just the list of executable files themselves.

@@ +1690,5 @@
> +# FOO_FILES := foo bar
> +# FOO_DEST := target_path
> +# FOO_EXECUTABLES := 1
> +# INSTALL_TARGETS += FOO
> +define install_file

I might call this "install_file_rule" or template or something.

@@ +1692,5 @@
> +# FOO_EXECUTABLES := 1
> +# INSTALL_TARGETS += FOO
> +define install_file
> +libs:: $(2)/$(notdir $(1))
> +$(2)/$(notdir $(1)): $(1) | $(call mkdir_deps,$(2))

Pymake doesn't support order-only prerequisites, last I checked.
Comment 3 Mike Hommey [:glandium] 2012-07-23 23:53:38 PDT
Created attachment 645211 [details] [diff] [review]
Generic install/copy rule
Comment 4 Ted Mielczarek [:ted.mielczarek] 2012-07-27 05:44:45 PDT
Comment on attachment 645211 [details] [diff] [review]
Generic install/copy rule

Review of attachment 645211 [details] [diff] [review]:
-----------------------------------------------------------------

::: config/makefiles/autotargets.mk
@@ +66,5 @@
>  # or stale logic so add a stub target to handle the request and warn for now.
>  .mkdir.done:
>  ifndef NOWARN_AUTOTARGETS # {
>  	@echo "WARNING: $(MKDIR) -dot- requested by $(MAKE) -C $(CURDIR) $(MAKECMDGOALS)"
> +	@$(TOUCH) -t 197001030000 $@

Pymake's touch builtin doesn't support -t, so you should probably just s/$(TOUCH)/touch/ here:
http://hg.mozilla.org/users/bsmedberg_mozilla.com/pymake/file/tip/pymake/builtins.py#l85
Comment 6 Ed Morley [:emorley] 2012-08-07 07:33:33 PDT
https://hg.mozilla.org/mozilla-central/rev/8bd1b7ccff26
Comment 7 neil@parkwaycc.co.uk 2012-08-10 13:02:40 PDT
Comment on attachment 645211 [details] [diff] [review]
Generic install/copy rule

>+# Make the timestamp old enough for not being a problem with symbolic links
>+# targets depending on it. Use Jan 3, 1970 to accomodate any timezone where
>+# 197001010000 would translate to something older than epoch.
>+	@$(TOUCH) -t 197001030000 $@
My FAT32 partition doesn't like this. Any chance of using 198001010000 instead?

Note You need to log in before you can comment on or make changes to this bug.