chiark / gitweb /
new ours-m<layer>.ps files for layout editing; pass input file to m4 by name rather...
[trains.git] / layout / Makefile
index a2865983ab75f81a40d0fc23e06ff6f317daf9e6..bedb221ad88819e6d21210acd744dfb30853189b 100644 (file)
@@ -15,27 +15,33 @@ LAYERS_LS=  0 10 20
 LAYERS_PS=     $(addsuffix .ps, $(LAYERS_LS))
 LAYERS_L=      $(addprefix ours-l, $(LAYERS_PS))
 LAYERS_E=      $(addprefix ours-e, $(LAYERS_PS))
-LAYERS=                $(LAYERS_L) $(LAYERS_E)
+LAYERS_M=      $(addprefix ours-m, $(LAYERS_PS))
+LAYERS=                $(LAYERS_L) $(LAYERS_E) $(LAYERS_M)
 
 LPAGES=         $(foreach x, 0 1 2 3 4 5 6, $(foreach y, 1 2 3 4 5, ours-p0-$xx$y.ps))
 
 CPROGS=                subseg2display compose-segenco
 
-default:       $(CPROGS) for-test-ui
-all:           default lpages layers extras
+default:       $(CPROGS) for-test-ui layers extras
+all:           default lpages
+for-pic:       ours+pindata.asm
+recurse:       $(CPROGS) for-pic for-test-ui
 for-test-ui:   ours.graph.c ours.redactgraph ours.raw.neato.ps \
                ours.redacted.neato.ps ours.layout-data.o \
-               ours.dgram-bot.segcmap subseg2display ui-plan-bot.ppm
+               ours.dgram-bot.segcmap ours.dgram-bot.plandata.c \
+               ours.dgram-bot.plandata.o
 
 layers:                $(LAYERS)
 lpages:                $(LPAGES)
-extras:                dualjn-a.ps parts.ps
+extras:                ours-a.ps ours-al.ps dualjn-a.ps parts.ps
 
 include ours.dgram.m
 include segencolayers.m
 
-NETPBM=                -lnetpbm
-# -lppm
+NETPBM =       -lnetpbm
+ifeq (,$(shell test -f /usr/lib/libppm.so || echo no))
+NETPBM +=      -lppm
+endif
 
 REDACT=                consistency movfeatsplitedges   \
                consistency movfeatrmstubs      \
@@ -65,7 +71,7 @@ compose-segenco: compose-segenco.o
                        reversers.pin-info detectors.pin-info
                ./$(filter-out %.pin-info, $^) $o
 
-%-pindata.asm: %.layout-data.c
+%+pindata.asm: %.layout-data.c
                @:
 
 %.pin-info:    pin-info-gen ../pcb/%.net
@@ -75,10 +81,10 @@ compose-segenco: compose-segenco.o
                $(LINK)
 
 %.d4:          %.m4 $(M4INCS) Makefile
-               m4 -s <$< $o
+               m4 -s $< $o
 
 %-a.ps:                %.d4 layout
-               ./layout <$< $(LAYOUTOPTS) '-E*l' $o
+               ./layout <$< $(LAYOUTOPTS) '-E*lD' $o
 
 %-al.ps:       %.d4 layout
                ./layout <$< $(LAYOUTOPTS) '-e*C' '-ep=rm' $o
@@ -111,6 +117,10 @@ ours.graph.c:      extractgraph ours.dgram-bot.p0.segenco.ps
 ours-l%.ps:    ours.d4 layout
                ./layout <$< -l$* $(LAYOUTOPTS) $(XLAYOUTOPTS_LAYER) $o
 
+ours-m%.ps:    ours.d4 layout
+               ./layout <$< -l$* -E'=*aRscLDMno' \
+                       -e'p=*rm' -E'=5RNLDA' -E'*~=5rCdsml' $o
+
 ours-e%.ps:    ours.d4 layout
                ./layout <$< -l$* -E'=*aRsclMno' \
                        -e'p=*rm' -e'=5RN' -E'*~=5rsm' -e'p~=5r' -e'*=*l' $o
@@ -135,15 +145,20 @@ subseg2display.o compose-segenco.o: segcmap.h
 
 clean:
                -rm -f -- *.d4 *~ t.* *.m *.new core
-               -rm -f ours-*.ps parts.ps
+               -rm -f ours.*.ps ours-*.ps parts.ps *.neato.ps ours.*.neato
+               -rm -f dualjn-*.ps
+               -rm -f *.pin-info *+pindata.asm
+               -rm -f *.redacted.forsafety *.redacted.forneato
                -rm -f *.oprint-*.ps *.run-layout
                -rm -f *.segcmap *.segcmapreq
                -rm -f *.dgram-*.p*.segenco.ps *.dgram-*.p*.segenco.ppm
-               -rm -f $(CPROGS) *.o *.d
+               -rm -f *.dgram-*.plandata.c ours.graph.c ours.layout-data.c
+               -rm -f $(CPROGS) *.o *.d ours.redactgraph
+               -rm -f tmp.* ui-plan-*.ppm
 
 .PRECIOUS:     $(OPRINTS)
 .PRECIOUS:     %.segcmap %.segcmapreq %.segenco.ppm %.d4 %.neato %.raw.neato
 .PRECIOUS:     %.redactgraph %.redacted.forsafety %.redacted.neato
-.PRECIOUS:     %.layout-data.c
+.PRECIOUS:     %.layout-data.c %.pin-info
 
 include $(wildcard *.d)