source: tags/ms_r17q3/GDEHELP/Makefile

Last change on this file was 14799, checked in by westram, 9 years ago
  • make 4.1 spams the compile log with
    recipe for target 'xxx' failed
    
    • replaces -oktofail by oktofail || true
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1
2MENUS_TGT = $(ARBHOME)/lib/gde/arb.menu
3MENUS_SRC = ARB_GDEmenus.source
4
5SED:=$(ARBHOME)/SH/arb_sed
6
7HELPFILELIST=helpfiles.lst
8GENHELPDEST=./HELP_GEN
9GENDOCDEST=./HELP_DOC_GEN
10
11SUBMENUS=$(wildcard MENUS/*.menu)
12GENMENUS=$(SUBMENUS:.menu=.genmenu)
13
14PPP:=./pp.pl
15CLEAN:=./cleanmenu.pl
16
17# ---------------------------------------- help for refactoring
18MENUS_EXPECTED = ARB_GDEmenus.expected
19
20# check expected result (to avoid unwanted changes)
21# call 'make update_expected' to expect the current result
22
23#CHECK_AS_EXPECTED = check_as_expected
24CHECK_AS_EXPECTED = 
25
26# ----------------------------------------
27
28all: $(MENUS_TGT) help $(CHECK_AS_EXPECTED) rm_obsolete
29
30MENUS/%.genmenu : genmenu.header
31
32MENUS/%.genmenu : MENUS/%.menu
33                ( cat genmenu.header; $(SED) -e "s/^[ ]*//" ) < $< > $@
34
35MENUS_DIRTY=ARB_GDEmenus.dirty
36
37$(MENUS_DIRTY) : $(MENUS_SRC) $(GENMENUS) Makefile $(PPP)
38        $(PPP) -IMENUS $(MENUS_SRC) >$@
39
40$(MENUS_TGT) : $(MENUS_DIRTY) $(CLEAN)
41        chmod a+w $@ || true
42        $(CLEAN) <$(MENUS_DIRTY) >$@
43        rm $(MENUS_DIRTY)
44        chmod a-w $@
45
46# ------------------------------------------------------------
47
48update_expected: $(MENUS_TGT)
49        cp $(MENUS_TGT) $(MENUS_EXPECTED)
50
51check_as_expected: $(MENUS_TGT) $(MENUS_EXPECTED)
52        diff --unified --ignore-space-change --ignore-blank-lines  $(MENUS_EXPECTED) $(MENUS_TGT) 
53
54# ------------------------------------------------------------
55
56help: $(HELPFILELIST)
57        @test -d $(GENHELPDEST) || mkdir $(GENHELPDEST)
58        @test -d $(GENDOCDEST) || mkdir $(GENDOCDEST)
59        @$(MAKE) -f Makefile.helpfiles "GENHELPDEST=$(GENHELPDEST)" "GENDOCDEST=$(GENDOCDEST)" "HELPFILELIST=$(HELPFILELIST)"
60
61$(HELPFILELIST): $(SUBMENUS) Makefile
62        grep -ih '^itemhelp:' $(SUBMENUS) | $(SED) -e 's/^itemhelp://' | sort | uniq > $@
63
64# ------------------------------------------------------------
65
66rm_obsolete:
67        @(test -f ARB_GDEmenus && rm -f ARB_GDEmenus) || true
68
69clean: $(HELPFILELIST)
70        @$(MAKE) -f Makefile.helpfiles \
71                "GENHELPDEST=$(GENHELPDEST)" \
72                "GENDOCDEST=$(GENDOCDEST)" \
73                "HELPFILELIST=$(HELPFILELIST)" \
74                clean
75        rm -f $(GENMENUS) $(MENUS_TGT) $(HELPFILELIST)
76
Note: See TracBrowser for help on using the repository browser.