Feature #3095

Dependency check (output of image files in makefile format)

Added by planetmaker about 8 years ago. Updated about 8 years ago.

Status:ClosedStart date:2011-09-26
Priority:NormalDue date:
Assignee:planetmaker% Done:

100%

Category:-
Target version:-

Description

For building NewGRFs it maybe desirable to get a list of image files the NewGRF depends on.
The attached patch implements a new output type which writes a Makefile which (by default) depends the grf on the image files found in the NML

dep_check.diff Magnifier (4.24 KB) planetmaker, 2011-09-26 06:18

dep_check2.diff Magnifier (4.19 KB) planetmaker, 2011-09-26 06:25

dep_check3.diff Magnifier (4.29 KB) planetmaker, 2011-09-26 07:13

dep_check4.diff Magnifier (8.24 KB) planetmaker, 2011-09-26 08:03

dep_check5.diff Magnifier (4.96 KB) planetmaker, 2011-09-26 10:36

dep_check6.diff Magnifier (5.04 KB) planetmaker, 2011-09-29 09:05

Associated revisions

Revision 1668:ca35b734005e
Added by planetmaker about 8 years ago

Feature #3095: Introduce --dep command line parameter to allow writing of makefile style dependencies

Revision 1668:ca35b734005e
Added by planetmaker about 8 years ago

Feature #3095: Introduce --dep command line parameter to allow writing of makefile style dependencies

Revision 1670:2427904ee63f
Added by planetmaker about 8 years ago

Feature #3095: Add targets --MT and --MF to specify the dependency target and the file to write dependencies to
Note: we cannot use the exact gcc syntax of -MT and -MF as our option parser requires multi-char options to be long

Revision 1670:2427904ee63f
Added by planetmaker about 8 years ago

Feature #3095: Add targets --MT and --MF to specify the dependency target and the file to write dependencies to
Note: we cannot use the exact gcc syntax of -MT and -MF as our option parser requires multi-char options to be long

History

#1 Updated by planetmaker about 8 years ago

  • File deleted (dep_check.diff)

#2 Updated by planetmaker about 8 years ago

Printing NewLine was missing.

Typical output with
nmlc --dep firs.dep firs.nml
is along the lines of
firs.grf: sprites/graphics/industries/foodmarket_snow.png
firs.grf: sprites/graphics/industries/dairy.png
firs.grf: sprites/graphics/industries/hardwarestore.png
firs.grf: sprites/graphics/industries/stockyard.png
firs.grf: sprites/graphics/industries/oilwell.png
firs.grf: sprites/graphics/industries/glassworks.png
firs.grf: sprites/graphics/industries/biorefinery.png
(...)

#3 Updated by planetmaker about 8 years ago

And a fixed comment and removed the unused newline method in output_dep.py ...

#4 Updated by planetmaker about 8 years ago

Hm, it failed on missing image files, which is stupid for a dependency check. New version - though probably the output type themselves should get a property which describes whether parsing of the image files is required.

#5 Updated by planetmaker about 8 years ago

  • File dep_check4.diff added

Lalalala. And another version which implements the output file property parse_image_files and the method parse_images. There's a bit of whitespace change involved in main.py, indenting all the image file stuff.

#6 Updated by planetmaker about 8 years ago

  • File deleted (dep_check4.diff)

#7 Updated by planetmaker about 8 years ago

#8 Updated by planetmaker about 8 years ago

Renamed the check to the better suited skip_sprite_checks.

#9 Updated by planetmaker about 8 years ago

One thing I wondered: if the dep check cannot be executed: should the programme just print a warning and silently continue - or should it be a critical error?

Silently continue (as now) might make sense when other output options are given at the same time.

#10 Updated by planetmaker about 8 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 30 to 100

Also available in: Atom PDF