I am trying to (ab)use a Makefile to describe a process of data generation. My data are a raster data mosaic tiles covering the world, in chunks of 30°×20° (longitude×latitude), where the tile labels are derived from the GMTED names:

```
lat := 70S 50S 30S 10S 10N 30N 50N 70N
lon := 180W 150W 120W 090W 060W 030W 000E 030E 060E 090E 120E 150E

tiles := $(foreach LAT,$(lat),$(foreach LON,$(lon),$(LAT)$(LON)))

```

For some step in the computation, each tile and its 8 neighbors are needed. So for example, one rule is

```
distances-extended-50S180W.tif: distances-50S180W.tif distances-70S150W.tif distances-70S150E.tif distances-50S150W.tif distances-50S150E.tif distances-30S150W.tif distances-30S150E.tif distances-70S180W.tif distances-30S180W.tif
    python extend 50S180W

```

(so the `lon`s wrap, but for the `lat`s, the extremes have just 6 instead of 9 prerequisites.) How can I make this more concise than generating all these 96 rules externally and including them into the makefile?