Date: Thu, 19 Jun 2008 12:32:15 +0200 From: Pietro Cerutti <gahr@FreeBSD.org> To: Kris Kennaway <kris@FreeBSD.org> Cc: ports@FreeBSD.org Subject: Re: INDEX build optimizations - please review Message-ID: <485A35AF.3060703@FreeBSD.org> In-Reply-To: <485A3552.9000803@FreeBSD.org> References: <484EAFAC.3020208@FreeBSD.org> <485A3314.8010304@FreeBSD.org> <485A3552.9000803@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Kris Kennaway wrote: | Pietro Cerutti wrote: |> -----BEGIN PGP SIGNED MESSAGE----- |> Hash: SHA512 |> |> Kris Kennaway wrote: |> |> | ********************************************************************** |> | ********************* NOTE TO PORT DEVELOPERS ************************ |> | ********************************************************************** |> | |> | Variable assignments with != are bad! Try as hard as you can to avoid |> | using them -- especially in Mk/*! Every time something processes your |> | makefile it will spawn a command, even if it is not relevant for the |> | operation being performed. If you need to run shell commands, try to |> | isolate them within a makefile target. You can avoid code duplication |> | by assigning the *shell commands* (not their output) to a variable and |> | inserting it into your code block. |> | |> | e.g. instead of |> | |> | -- |> | VARIABLE!= do some shell stuff; do some other stuff |> | |> | target: |> | echo ${VARIABLE} |> | -- |> | |> | do this (or similar): |> | |> | -- |> | VARIABLE_CMDS= do some shell stuff; do some other stuff |> | |> | target: |> | echo $(${VARIABLE_CMDS}) |> | -- |> | |> | This defers the command execution to the point where the target |> runs, so |> | in the case when the target is *not* run, then you avoid wasting one or |> | more process executions. |> |> Yes, in theory. |> |> Any clue why this doesn't work? |> |> SCHED_NAME= sysctl -n kern.sched.name |> |> all: |> ~ echo $(${SCHED_NAME}) | | Try $$(${SCHED_NAME}) (escape the $ you don't want make to process) mh yep... :) tnx! | | Kris - -- Pietro Cerutti gahr@FreeBSD.org PGP Public Key: http://gahr.ch/pgp -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEAREKAAYFAkhaNa4ACgkQwMJqmJVx944OVgCggOX/Pa/LkLltaQM/Orl+NESL SXAAn0tIPuesfM1DNU8Fnf89wHufU3+F =/McK -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?485A35AF.3060703>