4 ms·
zipfile.zip: $(wildcard dir/*.c) zip -ur $@ $? Note, $? will only include the prerequisites that are newer than the zipfile, and therefore, will on
by ori_b 13y ago
zipfile.zip: $(wildcard dir/*.c)
zip -ur $@ $?
Note, $? will only include the prerequisites that are newer than the zipfile, and therefore, will only update the files that have changed. You will not be re-zipping things repeatedly.
- bjourne 13y agoThat's for trying, but 1. doesn't work unless you have zip installed, 2. doesn't recurse the whole directory tree, 3. doesn't rebuild the target if a file is renamed or deleted, 4. uses volatile time stamps instead of content hashes to detect targets needing update. And is GNU make specific. Then what if you want bz2 compression instead of zip?
- mansr 13y ago1. Are you seriously complaining over make itself not creating the zip file, duplicating the functionality of the 'zip' tool? 2-3. This command does what you want: zip -R -FS foo.zip '*.c' 4. In practice timestamps work just fine unless you deliberately sabotage them. To use content hashes, the hashes of the input files when creating a target would need to be stored somewhere for future reference. This storage place could just as easily be corrupted. Make is a build tool, not a VCS. Treat it as such. Yes, some things are specific to GNU make, but it is the de facto standard, something waf can only dream of. If you're going to complain about something being non-standard, your suggested alternative should be more of a standard, not less. If you want bz2, why did you ask for zip?