Wouter van Ooijen wrote: > ifndef CRYSTAL > error "no CRYSTAL defined in your Makefile" > endif Maybe make that $(error no CRYSTAL defined in your Makefile) (Did you see my previous message about the $(error message) function?) >> You could add another target that all your real target depend on, and >> put your tests in there, and make them return a failure if the required >> conditions aren't met, then make will stop at that point. > > That seems to be my only option so far, but that requires that makes > interprets the whole Makefile, because rule-execution starts only after > full interpretation. Right. What is so bad about it? The only thing bad I see is that this check gets run for every target (that is, for every file that gets made). Which is probably not a biggie -- and once they understand enough to be concerned about execution speed, they can remove the variable check. > I am trying to make an environment for ARM chips for beginners, so I > don't even want to expose them to make's (full) syntax. Unless teaching make syntax is part of the objective, I think I seriously would look at alternatives, like maybe Jam. I don't like the makefile structure and syntax. (The syntactical difference between tabs and spaces alone is for me a killer.) > include ARK/Makefile.inc Just a thought: .inc is way too overloaded IMO -- and the most common standard is asm include files. The way you want to structure your makefile, nothing bad happens if it is called on its own. So calling it makefile.mak has a number of advantages -- automatically colored syntax and automatically correct tab settings (important! see above... :) in editors that support this are just two of them. > I can write the if's that do this checking, but I don't know what to put > inside the if's to > 1. generate an error > 2. stop make, without interpreting the rest of the file Try "$(error message)" (see above). > I think I can create something that would generate an error and stop > make, but as part of a rule, so that would work only after make has > interpreted the full makefile, which might produce other errors because > the user's specs where wrong. I don't think that's a problem. And I don't think you can instruct make to execute any commands outside of a rule. As I understand the "language", it only executes commands as part of a rule. So you probably want a target like checkSetup: ifndef CRYSTAL $(error no CRYSTAL defined in your Makefile) endif (plus any other checks you want to run) and make all your targets dependent on checkSetup. Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist