|  |

 |
|
Short reviews and ratings for recent movies I saw. The ratings are Netflix-style: out of 5 with 1 being the least possible.
- Sherlock Holmes 2: A fun movie where you leave your head aside and enjoy the ride. Significantly better than the first one. Saw it in the theater which may add a star to the rating. 4 stars
- Moneyball: Saw it about halfway. Typical, predictable sports movie. Second half might be great but seemed like it'd be a complete waste of time. Not a bad movie mind you, but we've seen everything in it multiple times before. It did not need to be made. 2 stars
- The Dirty Picture: Good acting by Vidya Balan and especially Naseer who is always superb, but the movie was a mess. It had Lion in Winter dialogue, showed random scenes over and over again, and skipped or made a hash of most things that might have been interesting. That dancing on the car was so weakly done, in a studio, with so few people, and then apparently Tushar cant see her so he has to climb onto another car, but then from the top of her car they can actually see Naseer's face fall. Indian audiences do not understand that a good topic does not necessarily mean a good movie. 2 stars
- Saheb Biwi and Gangster: Now this was a terrific movie. Good acting, especially by Jimmy Shergill who was superb in his role as the "prince". The true greatnesss of this movie however was in the realism of the royal lifestyle. Even the costumes were perfect – never more so than when Saheb and Biwi go for the matriarch's birthday. This kinda reminded me of Johnny Gaddar – it even shared JG's weakness of closing threads too fast. This movie should have been longer. 5 stars
- Rockstar: And this one should have been shorter. Like, not been made at all would have been nice. First of all, for a rockstar, this guy plays rock a sum total of ONCE (and I'm being liberal), and doesnt even have a fucking band. And why is he dressed like Gaddafi? The actual theme is glurge of the Twilight nature, with no chemistry between the leads because Nargis Fakhri cannot act and the director doesnt know what he's doing, so all thru the movie, even when they are supposed to be in the throes of all-encompassing passion, they look like people who've just met in a bar. Awful music too: Rahman has sufi-cient ego to think that Sufi music is rocking and audiences will sing along to "Naadaan parindey ghar aaja" just like they did to "Na na, na, na, na" in Rock On (a 5 star movie with 5 star music). To think that Rockstar was a hit in India and SBG was only semi-successful. It's like to make a hit in India, you gotta take the recipe and replace anything good with its opposite. "This cake calls for a pound of sugar you say? Nah, let's use salt." 1 star
Post comment | Add to memories | Share | Link
 |
|
Ever since Al Gore made that video, we have been asking the wrong question. To me it is stupid to ask "Is global warming happening?" (yes) or "Is it caused by humans?" (yes) when there are better questions such as, "Is global warming bad?" or "Can we, who cannot predict tomorrow's weather, claim with a straight face that farming Greenland for the loss of polar bears and Maldives is a poor tradeoff?"
When the modern human came into existence, where I live now was under a glacier. And now, no glacier and a lot more people. It's not a huge stretch to claim that being able to live where there was only ice has something to do with our thriving survival. I am sure some coastal folk had to move inland over the course of these years too. What's changed so fundamentally since then that the effect of global warming has to be the inverse? How can anyone say with any degree of authority that this what we have here is the "right" temperature of the earth? Or even that this rise in temperature is "too" fast?
The fact is we dont know much. And when we dont know much, we should focus on what palpably affects us. I am totally against polluting the air, destroying nature, overfishing and stuff like that. But it's for more palpable reasons such as health, quality of life, sustainability; not for global warming.
I think people tend to lose focus about their place in the world. We dont matter: not to the earth, not to life, and most likely not even to mankind. If we stay humble, we might do the right thing for the right reason, which might convince others better than a theory that turns facts into hubristic predictions.
3 Comments | Post comment | Add to memories | Share | Link
 |
|
On the third day of the India vs England 2nd test, the batsmen ran three on the last ball before tea. Ian Bell, the batsman at the striker's end then proceeded to walk off for tea, because both the batsmen and much of the fielding team, including Praveen Kumar who collected the ball, thought that the ball had gone for four. But it hadnt. Dhoni got the ball back and smartly took the bails off. After verifying that the ball had indeed not touched the rope, Bell was correctly given out. A stupid error on the batsman's part, paid for, am I right?
No! After being affected by the crowd's jeers (it was an English crowd, of course they will jeer), Team India decided to recall Bell – the Bell who tried to squirm out of responsibility for his actions by claiming the umpire had called over when he clearly hadnt – because giving him out was against the spirit of the game.
So what is this spirit of the game exactly? Give a person out only if he deserves to be out? What if the umpire gives him out wrongly? There's DRS for that, but (a) India is against DRS (b) it cant be a solution for everybody because of the expense. So it must mean that if you think the umpire gave the batsman out unfairly, he must be recalled. What if the batsman didnt intend to play the shot, you know, if he lost his balance and hit the stumps, or – horrors – he meant to loft it at the no man's land over there and not straight to the fielder, honest! I mean, when does it end?
You know what a spirit is? A ghost. Something that doesnt actually exist. Something that you scare kids with. In reality, the laws of the game are its spirit, same as your body is your soul. And you know what the goal of a sport is? To win, according to the laws of the game.
A captain's principal responsibility is to his side, not to a ghost. He should be smart on the field (as Dhoni was), unruffled by the crowd (as Dhoni wasnt), and a leader who should look to win (as Dhoni doesnt seem to care about). Today as I write this, India has just started their chase of 478, a massive target, which could have been a 100 or more smaller had Bell been allowed to remain in the pavilion sipping his tea. It's the difference between a hopeless situation and a difficult but winnable one. Bell's recall lost us the game – make no mistake about it.
So what were the reactions? Mostly pro-Dhoni, which is unfortunate. Botham and Manjrekar get it; Gavaskar and Ganguly, who themselves would have done no such thing (in fact when the run out went down Gavaskar was hopping in the commentary booth all for Bell being given out), are on Dhoni's side, perhaps because they want to appear less controversial; Bhogle as usual uses a lot of words to say absolutely nothing.
Why did the recall happen, and why is it so popular among us Indians? I cant help but recall (heh heh) our colonial past. How a significant proportion of our freedom fighters were willing to become shaheed for their cause (how about get some goddamn results and stay alive instead?). How the British used all tricks in the book and outside it, to achieve the end result – in this case, a simple and free "shame your opponent". They build empires, we wallow.
How will this change the game? In no way. Dhoni's decision will be talked about for decades, but rarely emulated. As when Walsh lost the World Cup for the West Indies, insiders will openly praise the gentlemanliness but privately mutter "sanctimonious bastard". Yes, once in a while, another dolt will remember the spirit of the game, and there will forever be another L in a column where a W could have been.
1 Comment | Post comment | Add to memories | Share | Link
 |
|
We have been up to a lot of things at the Chengiz household, so it's high time I updated the blog.
India trip
Had an awesome India trip in Mar-Apr. By pure luck we were there during the World Cup. After buying the tickets in Jan, I was like, let's see if I'm gonna be able to catch the IPL. Oops, leaving India just before it starts. And then, what's on? What? No test series? How can that be? Life sucks. Wait a minute! What? World Cup! Wow! And then India won! Highlight of the trip cricket-wise was flying back from Bangalore to Mumbai at the time India beat Pakistan in the semifinal: people cheering at the TV at the gate and not boarding until the last minute, pilot announcing score every ten minutes, India wins and firecrackers are visible from the sky as the plane circles Mumbai airport, and while heading home, processions in the streets with bands, motorcyclists weaving thru traffic with pillion riders waving flag and cheering, road closed outside Shiv Sena Bhuvan – exhilarating experience, worth missing the last part of the match especially because the outcome was quite predictable by the time.
And in Bangalore we had a great time. Mysore and Banerghatta safari trip were memorable. What I'll also never forget is the roadside meal of chicken and rice I had sitting on the footpath in front of the bus station for Rs. 35 from a women who served meals from a cart laden with big aluminium dabbas and with whom I could barely communicate. The little things.
And of course, Goa. Probably my favourite place on the planet. Had feni, fish, and an awesome day at the beach. I could literally live on Goa's beaches for ever. Need to take a shower and crap once in a while, and I'm golden. The shack where we hung out had a worker who was so drunk he could barely walk. He was a nice guy – I would have let him hold the boy but the server stopped us. The server was so fond of the boy, he lectured us against spanking him, and took him for a walk into the water. About the drunk, the server tells me, "apna cook hai sir, kya karne ka?". Then he flirted with an old firang woman and probably would leave with her.
Back in Mumbai the final happened. I predicted early on that SL would make 270 (and I won – the others were saying 220 at most), and that India would lose by 20-30 runs (boo hoo, but wait... smile). My dad said when Sachin got out that we will win, he won!
Movies
Caught up on a lot of Oscar winners. Best movie of last year – Black Swan pips Social Network for my best Oscar pick, but wouldnt have minded either winning. King's Speech, which won, was so mainstream by comparison – good movie, but come on, nowhere near great. Black Swan was so engrossing – a little bit of thought and you could have predicted what was going on, but Aronofsky showed it so well that the psychological stuff itself was more dread-inducing than any alternative. And again the little things – blood spouting out of severed artery is nowhere near as scary as someone peeling off their own skin and nails. The great thing about Social Network was how relentlessly entertaining it was. Not a boring or slow minute, and I am glad they tamed the Aaron Sorkin faster-than-the-eye-can-see dialogue after the first scene. And the whole thing about people saying Zuckerberg was painted in a bad light – I mean come on did you see the movie? He is a fricking golden boy.
Hindi? Didnt see a whole lot of good movies there. Game, which we saw in the theater, was crap. Tanu Weds Manu which we saw later was also crap. Both had Kangana Ranaut. Dont know what to make of her. On the one hand, she is too thin, cannot act, and sounds retarded when she opens her mouth. On the other hand, she has great screen presence while dancing – case in point here and here.
What else? Also saw Mi Shivajiraje Bhosle Boltoy, which was fun (sometimes unintentionally – fisherwoman telling him to buy bombil instead of paplet was the funniest scene in the movie). Oh and just resaw one of my favourite Hindi movie "final action" scenes (be wary: it's long and I can have strange – read oldfashioned – tastes).
New York, friends, birthdays and more
Went to New York! Went atop the Empire State building on one of the windiest days of the year (your legs gave way under you up there). Hung out with great friends. Who then came over for the boy's birthday and we all had cake and rides in a play park by our house. The boy loved it and got a lot of presents, although he was a bit perplexed about the concept – he says "where is happy birthday where is happy birthday?" on being woken up at midnight by our cake-bearing friends.
Now summer's here. All's well. And looking forward to kid#2 (not quite, just the kind of thing you say!).
1 Comment | Post comment | Add to memories | Share | Link
 |
|
- Three men are sitting in their cell in the Gulag. The first asks the second, "Why are you here?" The second replies, "Because I spoke out against Radek". The first says, "But I am here because I spoke out for Radek". They turn to the third man and ask him, "Why are you here?" He says, "I am Radek".
- A man goes to buy a car. He is given a delivery date five years into the future. "Morning or afternoon?" he asks. "Why does it matter?" "The phone guy is coming in the morning."
- An artist is commissioned to create a painting commemorating Lenin's visit to Poland. When the painting is unveiled at the Kremlin, there is a gasp from the crowd – the painting shows Lenin's wife in bed with Trotsky. "But this is a travesty!" splutters the commissioner, "Where's Lenin?" The artist replies, "Lenin's in Poland".
- "Comrade Stalin, this man is your exact double!"
"Shoot him!" "Umm maybe we could shave off his moustache?" "Yeah, I suppose you could shoot him that way too."
- "My wife has been going to cooking school for three years."
"Oh yeah? She must be a great cook by now." "No, they have only gotten to the part about the 20th Communist Party Congress so far."
- A man goes into a shop and looks around. "You dont have any fish?" he asks. The shopkeeper replies, "We are a butcher, we dont have any meat. The fish shop across the road doesnt have any fish."
- A hotel room is being shared by four people. One guy wants to sleep, the others are partying noisily. So he hits upon a plan. He goes down, asks the concierge to send up tea in half an hour, goes back to the room. Twenty minutes later, he picks up the ashtray and speaks into it, "Comrade Major, can you send up some tea?" The tea arrives instantly. Suddenly there's a hush. Everyone becomes quiet and the guy sleeps happily. In the morning he wakes up to find himself alone in the room. He runs down and asks the concierge what happened. The concierge says, "KGB picked up those guys." He is terrified on hearing this. "Oh dont worry," she adds, "Comrade Major liked your tea gag a lot."
- A man unknowingly walks into a checkpoint at night. "Halt! Papers!" Haplessly he shuffles in his pockets and drops a paper. The guard picks it up and haltingly reads, "U.ri.ne A.na.ly.sis". "Sounds like a foreigner, shoot him!" "Wait! 'Proteins none, Sugars none, Fats none...' You are free to go, comrade!"
- Stalin's secretary overhears a General mutter "Murderous mustache!" and immediately reports this to Stalin himself. Stalin calls for the General and asks him to explain. The General says, "I was talking about Hitler of course". Stalin is pleased and dismisses him. He then calls in the secretary. "And whom did you think he was talking about?"
- A Russian peasant is visited by an angel, who grants him 3 wishes. The peasant's first wish is for a glass of vodka. He drinks it, burps. Then he says, "For my second wish, turn this lake into vodka". The angel says so be it. The guy happily drinks from the lake, swims in it. The angel asks, "What is your third wish?" The peasant says, "You know what, I will have another glass of vodka".
Post comment | Add to memories | Share | Link
 |
|
Short reviews and ratings for recent movies I saw. The ratings are Netflix-style: out of 5 with 1 being the least possible.
- Get Him to the Greek: The characters are well done, and Russell Brand especially plays his part very well, but overall I thought this movie was not as good as reported. While it was worth a watch, it just wasnt funny enough. Too much senti kills comedy dead, and this one got too senti in the end. And the writers/director really dropped the ball on the threesome scene – it was forced, and neither realistic nor funny. 3 stars
- An Education: Completely agree with Metwoh about Carey Mulligan – she is awesome and the movie is worth watching for her alone. It could and should have been great though, but it fell short, mainly because the writing wasnt good enough for the gal – yeah she was that good. 4 stars
- All About My Mother: I loved Almodovar's Talk to Her, and Volver was pretty good too, but AAMM was a bit of a letdown. He was trying too many things and being too quirky. Cecilia Roth in the main role was really good though. 3 stars
- Mr and Mrs Smith: Self, next time please dont rent a movie because of the hoopla. Think: Brad Pitt, Angelina Jolie, obvious vehicle for has beens. You should have known this would be beyond awful. 1 star
- The Ghost Writer: Polanski is one of my favourite directors of all time. Chinatown is in my top ten or close. By far the best adaptation of Macbeth I've seen is Polanski's. Rosemary's Baby is superb and one of the best book adaptations ever. Ghost Writer doesnt have a very believable story line, but Polanski's direction is so good that it actually makes for a decent movie – in anybody else's hand it would have been crap. 4 stars
- Insaf ka Tarazu: Raj Babbar was as creepy as I remember, but the courtroom scenes were a letdown – too corny even for Bollywood. Its original, Lipstick, is a better movie, but Raj Babbar is the better villain. 3 stars
- Kick-Ass: Meh. It started off well, but then drowned itself with too many action scenes. It didnt know whether it wanted to be a comedy or an action movie. 3 stars
- Billu: I used to think Shahrukh was above Aamir's self-glorifying but boy was I wrong. And that was the least objectionable part of the movie. Irrrfan was "told" to be so dirt poor yet there never was any actual poverty "shown". And Lara Dutta was hopelessly miscast – half of India would love to be in Irrrfan's character's shoes, poverty or not. When I rented this movie I didnt know it was by Priyadarshan, or I wouldnt have bothered. 1 star
- The Secret in Their Eyes: An Argentinian murder mystery. Very well done and acted, but the actual plot was a bit of a letdown. Fine movie regardless. 4 stars
- Harry Brown: This was the best of the lot, partly because I love Michael Caine, but mainly because I wasnt expecting it to be very good. I thought it'd be another Gran Torino, which was part self-aggrandizing old guy, part comic relief, part civics and racial harmony lesson. In Harry Brown, the old guy stuff is more or less irrelevant, there's no comic relief, and everyone is white. This is an out and out thriller, and one of the better thrillers in recent times. I wonder why it wasnt advertised as such. It has more in common with Death Wish and The Brave One (and is a far better movie than either) than with Gran Torino. This is Caine's best thriller since Get Carter. And you may not like him as much as I do, but this old guy can act. 5 stars
5 Comments | Post comment | Add to memories | Share | Link
Conversation between me and Nandini:
Me: What are you watching?
Nan: How the Grinch Stole Christmas.
Me: What's that green creature?
Nan: That's the Grinch.
Me: I thought Scrooge was the Grinch.
Nan: No, Scrooge is like, a guy.
Me: I thought Scrooge was a duck.
Nan: No! They took that from the book. Scrooge is a character in Dickens' Christmas Carol. He is a cold hearted rich guy who is visited by ghosts of Christmas past present and future and then he becomes good.
Me: That's It's a Wonderful Life!
Nan: Yeah everything is a ripoff.
Me: Yeah.
Post comment | Add to memories | Share | Link
 |
|
The Girl with the Dragon Tattoo was a good movie of a good book. I wouldnt say the movie was better than the book. It was actually pretty faithful, but I do want to give it credit for giving short shrift to the whole corporate scam angle in the book, which DID NOT WORK. I didnt know what the hell Larsson was thinking with that one.
But that absolutely pales in comparison to what Larsson was thinking in The Girl who Played with Fire. The book is actually unread by me, but one can safely assume that this movie is pretty faithful too, because no mere adapted screenplay writer could come up with such horrendous ideas on their own.
In Dragon, the heroine was an enigmatic, troubled, tough but sometimes vulnerable, Gothic, bisexual, antisocial hacker. She was a good heroine, original, and the movie did a great job of the casting – Hollywood would have screwed it up by dolling her up. It'd have lost all the originality.
But in Fire, we sorely needed a male fantasy heroine – Angelina Jolie, or maybe Uma Thurman. Certainly between the movie and the sequel, the Girl has had time to join and graduate from the Deadly Viper Assassination Squad. Only that can explain how she can now do Kungfu moves, be a fantastic shot, and dig her way out of her own grave with three or four bullets inside her, and then successfully fight the bad guys.
Or maybe Larsson just finally got around to seeing Kill Bill. He certainly seems to have seen some James Bond movies. He takes two ideas from James Bond – (a) instead of killing the hero, villain switches on a ridiculous device that should in theory do the job, and leaves, leaving hero ample time to escape undetected, and (b) an indestructible blond giant villain sidekick.
Unfortunately, he screws both these ideas up, royally. For (a), he has no device. The whole point of these scenes is the device. If you're just gonna leave after setting fire to a barn the good guys are in, I mean what's the point? You might as well give them a ride back into town.
(b) is even worse, and no it's not because of the missing metal teeth. Larsson explains why the blond giant has no pain. Larsson has seen James Bond, but he has no idea why James Bond works. It's because there is a device, and an indestructible blond giant is an indestructible blond giant. If I were to take away one thing from "The Girl who Played with Fire", it's this:
If you want to put an indestructible blond giant in your book, just put the damn indestructible blond giant in your damn book, without giving him congenital analgesia.
Also if you write a successful book with a male investigative reporter and a troubled female hacker, and then you want to try your hand at writing a book about an insignificant male sidekick and a kickass female assassin, perhaps make it a separate book, not a sequel?
1 Comment | Post comment | Add to memories | Share | Link
 |
|
- Ebert sucks as a critic since he came back. There, I said it. I've been following his reviews for a long time, and not a single one in the last several years comes to mind that is any good. On the other hand, his blog is often worth reading. I wish the guy well, but he should have retired from critiquing when he was ahead.
- In a story, you dont need a trio or more of secondary characters. By secondary, I mean someone who doesnt have the point of view.
Let's take Harry Potter. Ron and Hermione, the twins (not triplets), etc. All duos, no trio, it works. Ramayan Ram has POV, Lakshman and Sita are the secondaries who follow him. Urmila stays behind for no sensible reason. Smart move by Valmiki. Because let's face it – what would Urmi have been doing when Sita crosses the Lakshmanrekha, rolling chapatis? Mahabharat POV switches between Yudhishthir, Bhim and Arjun; the other two are the secondaries. When do Nakul and Sahadev matter? Never, that's when. Three Musketeers Strangely all three of the title are secondary here, d'Artagnan has POV. Athos is the honorable father figure. Porthos is the loyal buffoon sidekick. Who remembers Aramis? You can take him out and not even have to change the title. Last but not the least, porn: threesomes, never foursomes. QED.
- Everyone's making their World Test XI team courtesy Cricinfo. Among the players you can select are such stalwarts of the game as Stewie Dempster and Martin Donnelly, who among them have played a total of 17 tests. That's one less than Gavaskar did – in 1983. At least he's on the list. Meanwhile Ponting's thinking "What did I do?" (for all of ten seconds before making another century).
- People love cancelled TV series with a passion. Arrested Development? Firefly? People wax silly over these. Even Conan, who was supported by more people than ever watched him. Actually I often found Conan amusing but his is the sort of comedy you enjoy when you're partly sleepy and/or partly drunk, fit for late late night but not late night. Newsflash: TV execs are not idiots, shows get cancelled because people are not watching. The fans even made Fox get Family Guy and Futurama back: Family Guy has stunk ever since, and Futurama has always stunk so it cant be doing better now.
- Q: What are the chances of a double dip recession?
A: It will surprise you to know that you can answer this question correctly without knowing jack shit of anything. And a real answer, a number, not some prevaricating bullshit, you are not a politician. Normally knowing nothing of something, you'd say 50%, but you gotta sound optimistic, yet not so optimistic that if you're wrong people call for your blood. One-third is the correct answer. And you neednt stick to economics – it works wonders elsewhere too.
Post comment | Add to memories | Share | Link
 |
|
Make's Only Job
tgt: dep1 dep2 ...
cmd1
cmd2
...
Above shows the barebones syntax of a Make rule. There is a target (tgt) that has one or more dependencies (dep1, dep2, ...). All these are supposed to be files. When make is invoked, if any dependency is newer than target, commands (cmd1, cmd2, ...; these lines start with a tab), are run in the shell. The commands are supposed to make file tgt from dep1, dep2, ... and hence the name Make.
A dependency may itself be a target:
dep1: dep1a
cmd1_dep1
In this case if dep1a is newer than dep1, first cmd1_dep1 will run, and then cmd1, cmd2, .... In other words, the timestamp lookup is hierarchical – a change in the "lowest dependency" will trigger the commands of all targets above it.
A dependency that doesnt exist as a file or as a target (we wont get into this but targets can be implicit) will cause an error. A target that doesnt exist as a file is considered (obviously) infinitely old; thus its commands will always run.
At its core, this is the only thing Make does. Everything else is a hack.
Hacks
The first thing to note is that the commands dont have to build the target. It is only supposed to be a file, no one cares if it isnt. Combined with the fact that non-existent files are considered infinitely old, one can use Make to do a (keyword -> command) mapping, for example:
clean:
rm *.o
Here, make clean will remove object files.
But wait! As many have found out after bouts of hair tearing, if Make finds a file called clean, it wont run the above command (clean has no dependencies so it is new enough). There is a way to get around this, at least in GNU Make, which is to call such targets phony:
.PHONY: clean
but as we can appreciate by now (especially given the choice of word "phony", ie. not legitimate, ie. not a file), this is sort of a hack on top of a hack.
As you can tell by now, the (keyword -> command) thing implies that you dont have to use Make to make anything. For example, I want you to run an analysis for me on the supercomputer. Instead of writing a command manual or a script, I can include a Makefile with my tarball, and ask you to do "make run" to run the analysis (which I can easily nohup and/or run in the background), "make view" to see the progress (this can be as simple as a "tail -f"), "make mailresults" to email me the results. The advantages of this are apparent: Make is available everywhere and I dont need to know any scripting language (of course I need to be familiar with unix to actually write the commands).
So yes, Make is versatile, but note at the back of the mind that this is all subverting Make's Only Job, so let's get back to it...
Unhack – let's do Make's Only Job right
Make's Only Job is to run commands when targets get out of date with respect to their dependencies. This timestamp behaviour of Make is its raison d'etre. Yet it is often forgotten. If done properly, nothing that is up to date should ever rebuild.
As an example, you want to store your object files in a directory obj. But you want to make the directory first. A naive Makefile may look like this:
a.out: setup obj/a.o obj/b.o
cc -o $@ obj/a.o obj/b.o
obj/%.o: %.c
cc -o $@ -c $<
setup:
-mkdir obj
Upon the first invocation of make:
- Directory
obj/ is made via target setup.
- Object files
obj/a.o, obj/b.o are made from source files a.c, b.c (it is assumed the latter exist).
- Executable
a.out is build from the object files.
Note: $< = first dependency, $@ = target, - in front of mkdir = ignore errors. So what's wrong with this? Let's see what happens when make is run again:
- First it looks for a file called
setup. It isnt there (remember this means it is out of date), so the mkdir command is run.
mkdir fails because obj/ already exists, but the error is ignored because of the minus.
- Now because one of
a.out's dependencies was out of date, its own commands must run. So a.out is built – needlessly, because it was not really out of date.
How can we fix this? We can rename the setup target obj. Now it is a file (directory counts) and it is not out of date at the second invocation, so a.out wont rebuild. Alternatively, one can use Make syntax to ignore directories that already exist. This is useful in case other things are using obj/, so that we dont want to look at its timestamp at all.
setup := $(filter-out $(wildcard obj),obj)
a.out: $(setup) obj/a.o obj/b.o
...
obj:
mkdir $@
Let's see what happens on the second invocation of make in the above case:
- Here,
setup is a variable instead of a target.
- The command
"wildcard obj" equals obj if file obj exists, else it is blank.
- Filtering it out of the string
"obj" negates it. Hence the variable setup equals obj if obj doesnt exist, else is blank.
- Thus if
obj exists, a.out doesnt even depend on obj, so it doesnt run the mkdir (which has lost the minus – we dont need to ignore errors any more).
- As nothing is out of date,
a.out is not built.
That's about the size of it. I have been using Make for more than a decade, and sometimes find it very easy to get caught up in the Hacks and forget Make's Only Job. A little revisiting of first principles is helpful, and the above purports to be only that.
Post comment | Add to memories | Share | Link
|
 |
|
 |
 |