root/Compose/Makefile @ 1956

Revision 1956, 2.7 KB (checked in by hans-christoph, 4 years ago)

Dopplung von enUS bei 'make config' verhindern

Line 
1#
2# Neo/Compose/Makefile
3# Autor: hcw@gmx.de
4
5# Ort der Modul-Dateien
6#
7SRC = ./src
8PSEUDO_MODULES_FILES = $(SRC)/enUS.module
9MODULES_FILES = $(sort $(PSEUDO_MODULES_FILES) $(wildcard $(SRC)/*.module))
10MODULES = $(notdir $(basename $(MODULES_FILES)))
11
12# Liste von Demofiles, werden bei 'make all' erzeugt.
13# Im Grunde ist dies seit 'make config' überflüssig.
14#
15DEMOFILES = \
16        XCompose_enUS_base \
17        XCompose_enUS_base_math \
18        XCompose_enUS_base_math_greek_lang \
19        XCompose_enUS_base_greek_lang \
20        XCompose_enUS_base_roman
21
22# Hilfsprogramme
23#
24CHECKCOMPOSE = ./check-compose.pl
25CONFIGURE = /bin/bash ./configure.sh
26
27# Nutzerkonfiguration für Zusammenstellung der Datei XCompose.
28# Datei .config wird von 'make config' interaktiv geschrieben.
29# Defaultwert, falls .config noch nicht existiert.
30#
31-include ./.config
32USER_XCOMPOSE ?= XCompose_enUS_base_math
33
34#
35# 'make' bzw. 'make all' erzeugt die Datei XCompose ohne Installation
36#
37
38all : XCompose $(DEMOFILES)
39
40#
41# 'make config' führt interaktive Abfrage der Konfiguration durch
42# und legt Ergebnis in .config ab
43
44
45config : $(PSEUDO_MODULES_FILES)
46        @if [ ! -f .config ] ; then \
47           echo "USER_XCOMPOSE = $(USER_XCOMPOSE)" > .config ; fi
48        $(CONFIGURE) $(MODULES)
49
50#
51# 'make XCompose_foo_bar_baz' erzeugt Datei aus Modulen foo bar baz
52#
53
54XCompose_% : $(MODULES_FILES) 
55        @echo "Erzeuge $@."
56        @echo "#" >$@ 
57        @echo "# Automatically generated file $@.  Do not edit." >>$@ 
58        @echo "#" >>$@ 
59        @for i in \
60        `echo $@ | sed -e 's/XCompose//;s/_/ /g'` ;\
61        do \
62           fn=$(SRC)/$$i.module ;\
63           if [ -e $$fn ]; then \
64              echo "# begin include module $$i" >>$@ ;\
65              cat $$fn >>$@ ;\
66              echo "# end include module $$i" >>$@ ;\
67           else \
68              echo "*** Warnung: Datei $$fn kann nicht eingebunden werden" ;\
69           fi \
70        done
71
72XCompose : $(USER_XCOMPOSE) $(wildcard .config)
73        cp $< $@
74
75#
76# Regeln für Pseudo-Module
77#
78# Im Grunde braucht src/en_US.UTF-8 gar nicht in der Neo-Distribution
79# enthalten zu sein; man könnte stattdessen auch an dieser Stelle
80# die Abhängigkeit
81#    $(SRC)/enUS.module : /usr/share/X11/locale/en_US.UTF-8/Compose
82# setzen.
83#
84$(SRC)/enUS.module : $(SRC)/en_US.UTF-8
85        @ ( \
86           echo "# File $@, wird aus $< durch Kopieren erzeugt." ;\
87           echo "#configinfo en_US.UTF-8, Standard unabhängig von Neo" ;\
88           cat $< \
89        ) > $@
90
91#
92# Installiere ins Homeverzeichnis
93#
94
95install : XCompose
96        cp XCompose $${HOME}/.XCompose
97
98#
99# Test der XCompose-Dateien auf Korrektheit
100#
101
102check :
103        @for i in $(wildcard XCompose*) ; do \
104           $(CHECKCOMPOSE) -q $$i || (\
105           echo Problem in Datei $$i. ;\
106           echo Mehr Informationen mit \`$(CHECKCOMPOSE) $$i\'. ); done
107
108#
109# weitere Standard-Targets
110#
111
112clean :
113        -rm -f XCompose_*
114        -rm -f XCompose
115
116distclean : clean
117        -rm -f .config
118        -rm -f $(SRC)/enUS.module
119
120.PHONY : all config check clean distclean install
121
Note: See TracBrowser for help on using the browser.