Aug 29

I posted before about Makefiles when a tool builds multiple targets, and some discussion was had. Further to that, a colleague found this cute solution and we refined it a little. It has several advantages over the last method I put forward:

  • It doesn’t require an additional file to be written to disk
  • It’s clearer in the makefile

And some advantages over the method ianb suggests in the comments to that post:

  • It uses two features rather than a hack (i.e. it clearly shows its fake dependency to be so)
  • It works on our system. (GAK why ianb’s solution didn’t)

So here it is:

# -- mode: Makefile; --

# Preamble
.PHONY: all
all: a b

# Rule 1
# The bar ("|") denotes an order-only dependency; i.e. _my_fake_file is
# updated, but that is not enough to cause the commands in this rule to be
# executed.
a b: | _my_fake_file
        @: # empty command

# Rules 2 amd 3
# .INTERMEDIATE means that _my_fake_file does not need to be built for its own
# sake.  So the commands will be executed here only if its prerequisites are
# newer than a or b.
.INTERMEDIATE: _my_fake_file
_my_fake_file: src
        touch a b

# finally, note that _my_fake_file is never created on disc.  If and when the
# rule is executed, make internally notes that the target has been built, and
# subsequent visits to Rule 1 do not cause Rule 3 to be evaluated.
Aug 28

Having driven the 10,000,000,000 miles to Norfolk at 0.000002 MPH, I was not going to go home again without having visited the Under The Pier Show at Southwold (Suffolk). It were great. And Southwold’s surprisingly genteel too. On the August Bank Holiday, parking and pub food were both hard to come by but there was a distinct absence of chavviness and even the souvenir shops were all locally hand crafted gubbins rather than placky mass-produced tosh.  In all it was terribly civilised, though a bit more Essexy than Norfolk.

Aug 27

There is nothing — absolutely nothing — half so much worth doing as simply messing about in boats.

– Ratty, the Wind In The Willows

Three nights on a cruiser on the Norfolk Broads.  The smell of the mudweight when weighed in the morning.  A crew paralysed by the hygiene facilities.  Mooring and casting-off single-handed.  Friendly locals and grumpy locals, but mostly friendly.  Windmills.  Learning about mooring in crosswinds.  More friendly locals.  Sitting on the stern in the middle of a broad in the evening, watching our neighbors shinning up their masts and taking photos of one another.  Betting on which grebe will surface first.  Pub lunches.  Pub dinners.   An ancient church.  Bumping the neighboring boat rather hard on arrival and again on departure.  4 Hours’ sailing to do a 10 minute drive.  Lovely Norfolk folk.

Aug 19

A bunch of us are doing the 100 pushups program. You measure yourself by doing “as many as you can”. I realise now that my problem with fitness is not my pain threshold but my futility threshold. I start to wonder what’s the point long before I would have to stop due to physical issues. So my initial test I squoze out 8 pushups before thinking it was a silly exercise and why didn’t I have a nice piece of chocolate or something. That makes me a rank 2.

There are six weeks’ programs of three days, so we’re doing monday wednesday friday and posting results online for the sake of amplifying peer pressure. The first day’s exercises take the form of four sets of mandatory pushups with a minimum rest of 60 seconds between them, followed by “as many pushups as you can manage”. So the last figure is a measure of how far you’ve come. Already this figure has gone up. I think I’ve raised my futility threshold!

7, 7, 5, 4, 10

Incidentally, I know what the point is to this exercise: it’s our salsa performance routine. There’s a lift where Rachael springs like a little elf onto my side and I twirl her around effortlessly before she alights without a sound. That’s the theory anyhow.

Aug 5

On the same shelf in Morrissons:

0.72 / 0.432 = 313?

072 / 0.432 = 313?

72 / 0.432 = 283?

72 / 0.432 = 283?

72 / 0.432 = 277?

72 / 0.432 = 277?

And a “special” offer from Barratts:

How much for all three?

How much for just one?

Aug 4

Say one stage in your build process is a tool that writes out a series of source files and config files. You might have a rule that looks a bit like this:

glue.c glue.h net_conf.xml error_list.config: application.config context.xml target.conf
        generate_glue.exe $^

The trouble is, this is exactly the same as specifying four rules, one for each of the goals. And, depending on the exact version of make you use, you may find that generate_glue.exe is run four times. If that takes more than 4 minutes then you’re going to get really mad. Especially if you have, say, 80 test applications to generate.

A pattern to get around this is to cause the dependency “tree” to reconverge around a marker that tells you when the generator was last run:

glue.c glue.h net_conf.xml error_list.config: glue_generated.touch
        # nothing here
glue_generated.touch: application.config context.xml target.conf
        generate_glue.exe $^
        touch glue_generated.touch

This way, glue_generated.touch gets checked for its age a bunch of times, but the generation action is only executed if some config file is newer than the touch file.

ISTR that this can fail too (maybe it’s if the time granularity is too large) because somewhere I ended up with a horrible bunch of macrology that actually tested the file age explicitly in order to avoid it STILL running the tool n times.

Anyhow. This doesn’t seem to be anywhere on the internets, so it is now.

Aug 4

No matter what a Celebrity Chef might advise, don’t eat stuff with “bane” in the name. That goes also for:

  • deadly nightshade
  • poison ivy
  • black-eyed susan
  • bleeding heart

There are subtle clues about these plants.

 

August 2008
S M T W T F S
« Jul   Sep »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Archives

Meta