1 | |
---|
2 | .PHONY: clean all |
---|
3 | |
---|
4 | STD = standard.header |
---|
5 | SED:=$(ARBHOME)/SH/arb_sed |
---|
6 | |
---|
7 | POSTPROCESS=./postprocess_genhelp.pl |
---|
8 | HLP_DEPENDS=Makefile $(POSTPROCESS) |
---|
9 | |
---|
10 | ARBHOME=../.. |
---|
11 | |
---|
12 | GDEBASE=$(ARBHOME)/GDEHELP |
---|
13 | GDEGENDIR=$(GDEBASE)/HELP_GEN |
---|
14 | GDEWRITTENDIR=$(GDEBASE)/HELP_WRITTEN |
---|
15 | GDE_HELP=$(wildcard $(GDEGENDIR)/*.help) $(wildcard $(GDEWRITTENDIR)/*.help) |
---|
16 | GDE_HLP=$(addprefix agde_,$(subst .help,.hlp,$(notdir $(GDE_HELP)))) |
---|
17 | |
---|
18 | # -------------------------------------------------------------------------------- |
---|
19 | |
---|
20 | HLP = copyright.hlp changes.hlp agde.hlp |
---|
21 | |
---|
22 | # -------------------------------------------------------------------------------- |
---|
23 | |
---|
24 | all : $(HLP) $(GDE_HLP) |
---|
25 | |
---|
26 | $(HLP) : $(STD) Makefile |
---|
27 | $(GDE_HLP) : $(STD) Makefile |
---|
28 | |
---|
29 | %.hlp : %.header |
---|
30 | |
---|
31 | copyright.hlp : $(ARBHOME)/arb_LICENSE.txt $(HLP_DEPENDS) |
---|
32 | @echo Updating $@ from $< |
---|
33 | @(test -f $@ && chmod u+w $@) || true |
---|
34 | @cp $(STD) $@ |
---|
35 | @echo "# BUILD FROM: $<" >>$@ |
---|
36 | @cat $< | $(POSTPROCESS) $@ >> $@ |
---|
37 | @chmod a-w $@ |
---|
38 | |
---|
39 | changes.hlp : $(ARBHOME)/arb_CHANGES.txt $(HLP_DEPENDS) |
---|
40 | @echo Updating $@ from $< |
---|
41 | @(test -f $@ && chmod u+w $@) || true |
---|
42 | @cp $(STD) $@ |
---|
43 | @echo "# BUILD FROM: $<" >>$@ |
---|
44 | @cat $< | $(POSTPROCESS) $@ >> $@ |
---|
45 | @@chmod a-w $@ |
---|
46 | |
---|
47 | agde_%.hlp : $(GDEGENDIR)/%.help $(HLP_DEPENDS) |
---|
48 | @echo Updating $@ from $< |
---|
49 | @(test -f $@ && chmod u+w $@) || true |
---|
50 | @cp $(STD) $@ |
---|
51 | @echo "# BUILD FROM: $<" >>$@ |
---|
52 | @echo "# (which is generated itself)" >>$@ |
---|
53 | @echo "" >>$@ |
---|
54 | @echo "UP agde.hlp" >>$@ |
---|
55 | @cat $< | $(POSTPROCESS) $@ >> $@ |
---|
56 | @chmod a-w $@ |
---|
57 | |
---|
58 | agde_%.hlp : $(GDEWRITTENDIR)/%.help $(HLP_DEPENDS) |
---|
59 | @echo Updating $@ from $< |
---|
60 | @(test -f $@ && chmod u+w $@) || true |
---|
61 | @cp $(STD) $@ |
---|
62 | @echo "# BUILD FROM: $<" >>$@ |
---|
63 | @echo "" >>$@ |
---|
64 | @echo "UP agde.hlp" >>$@ |
---|
65 | @cat $< | $(POSTPROCESS) $@ >> $@ |
---|
66 | @chmod a-w $@ |
---|
67 | |
---|
68 | agde.hlp: $(GDE_HLP) agde.footer Makefile |
---|
69 | @echo Updating GDE overview $@ |
---|
70 | @(test -f $@ && chmod u+w $@) || true |
---|
71 | @cp $(STD) $@ |
---|
72 | @echo "# BUILD FROM: $<" >>$@ |
---|
73 | @ls agde_*.hlp | grep -v 'agde_.*_sub'| $(SED) -e 's/^/SUB /' >>$@ |
---|
74 | @echo "" >>$@ |
---|
75 | @echo "UP gde_menus.hlp" >>$@ |
---|
76 | @cat agde.footer >>$@ |
---|
77 | @chmod a-w $@ |
---|
78 | |
---|
79 | clean: |
---|
80 | rm -f *.hlp |
---|
81 | |
---|