http://marcin-wiacek.fkn.pl/english/zips/mygnokii.tar.gz
[gnokii.git] / Makefile
1
2 #
3 # $Id$
4 #
5 # Makefile for the GNOKII tool suite.
6 #
7 # Copyright (C) 1999 Hugh Blemings & Pavel Janík ml.
8 #               2000 Karel Zak
9 #
10
11 TOPDIR=.
12
13 #
14 # Makefile.global contains gnokii global settings
15 #
16 include ${TOPDIR}/Makefile.global
17
18 BIN_DIRS = gnokii
19
20 ifndef WIN32
21 BIN_DIRS += gnokiid
22 BIN_DIRS += mgnetd
23 BIN_DIRS += mgnetd/mg_demo_client
24 endif
25
26 DIRS =  common \
27         Docs \
28         $(BIN_DIRS)
29
30 #
31 # For now gnokiid and utils only make sense on Unix like systems.
32 # Some other stuff that makes only sense on Win32 platform.
33 #
34
35 ifndef WIN32
36 DIRS += utils
37 endif
38
39 GTK_DIRS =  xgnokii \
40             xlogos
41
42 PO_DIR   =      po
43 DOCS_DIR =      Docs
44
45 all: $(DIRS)
46         @if [ "x$(USE_NLS)" = xyes ]; then \
47                 $(MAKE) -C $(PO_DIR); \
48         fi
49
50         @if [ "$(GTK_LIBS)" ]; then \
51                 for dir in $(GTK_DIRS); do \
52                     if [ -e $$dir/Makefile ]; then \
53                         $(MAKE) -C $$dir; \
54                     fi; \
55                 done \
56         fi
57         @echo "done"
58
59 makelib:
60         @for dir in $(DIRS); do \
61             if [ -e $$dir/Makefile ]; then \
62                 $(MAKE) -C $$dir makelib; \
63             fi; \
64         done
65         @if [ "x$(USE_NLS)" = xyes ]; then \
66                 $(MAKE) -C $(PO_DIR) makelib; \
67         fi
68
69         @if [ "$(GTK_LIBS)" ]; then \
70                 for dir in $(GTK_DIRS); do \
71                     if [ -e $$dir/Makefile ]; then \
72                         $(MAKE) -C $$dir makelib; \
73                     fi; \
74                 done \
75         fi
76         @echo "done"
77
78 dummy:
79
80 $(DIRS): dummy
81         $(MAKE) -C $@
82
83 clean:
84         $(RM) *~ *.orig *.rej include/*~ include/*.orig include/*.rej
85         @for dir in $(DIRS); do \
86             if [ -e $$dir/Makefile ]; then \
87                 $(MAKE) -C $$dir clean; \
88             fi; \
89         done
90         @if [ "x$(USE_NLS)" = xyes ]; then \
91                 $(MAKE) -C $(PO_DIR) clean; \
92         fi
93
94 ifdef OWN_GETOPT
95                 $(MAKE) -C getopt clean
96 endif
97
98         @if [ "$(GTK_LIBS)" ]; then \
99                 for dir in $(GTK_DIRS); do \
100                     if [ -e $$dir/Makefile ]; then \
101                         $(MAKE) -C $$dir clean; \
102                     fi; \
103                 done \
104         fi
105
106         $(MAKE) -C Docs clean
107
108         @echo "done"
109
110 distclean:      clean
111         @if [ -e $(PO_DIR)/Makefile ]; then \
112                 $(MAKE) -C $(PO_DIR) distclean; \
113         fi
114         $(RM) Makefile.global config.cache config.log config.status \
115                 include/config.h \
116                 include/config.h.in \
117                 packaging/RedHat/gnokii.spec \
118                 packaging/Slackware/SlackBuild \
119                 po/Makefile.in \
120                 debian
121
122 dep:
123         @for dir in $(DIRS); do \
124             if [ -e $$dir/Makefile ]; then \
125                 $(MAKE) -C $$dir dep; \
126             fi; \
127         done
128
129         @if [ "$(GTK_LIBS)" ]; then \
130                 for dir in $(GTK_DIRS); do \
131                     if [ -e $$dir/Makefile ]; then \
132                         $(MAKE) -C $$dir dep; \
133                     fi; \
134                 done \
135         fi
136         @echo "done"
137
138 install:
139         @for dir in $(DIRS); do \
140             if [ -e $$dir/Makefile ]; then \
141                 $(MAKE) -C $$dir install; \
142             fi; \
143         done
144         @if [ "x$(USE_NLS)" = xyes ]; then \
145                 $(MAKE) -C $(PO_DIR) install; \
146         fi
147
148         @if [ "$(GTK_LIBS)" ]; then \
149                 for dir in $(GTK_DIRS); do \
150                     if [ -e $$dir/Makefile ]; then \
151                         $(MAKE) -C $$dir install; \
152                     fi; \
153                 done \
154         fi
155         @echo "done"
156
157 install-docs:
158         $(MAKE) -C $(DOCS_DIR) install
159         @echo "done"
160
161 install-strip:
162         @for dir in $(BIN_DIRS); do \
163                 if [ -e $$dir/Makefile ]; then \
164                         $(MAKE) -C $$dir install-strip; \
165                 fi; \
166         done
167
168         @if [ "$(GTK_LIBS)" ]; then \
169                 @for dir in $(GTK_DIRS); do \
170                         if [ -e $$dir/Makefile ]; then \
171                                 $(MAKE) -C $$dir install-strip; \
172                         fi; \
173                 done \
174         fi
175         @echo "done"
176
177 install-suid:
178         @for dir in $(BIN_DIRS); do \
179                 if [ -e $$dir/Makefile ]; then \
180                         $(MAKE) -C $$dir install-suid; \
181                 fi; \
182         done
183         @if [ "$(GTK_LIBS)" ]; then \
184                 @for dir in $(GTK_DIRS); do \
185                         if [ -e $$dir/Makefile ]; then \
186                                 $(MAKE) -C $$dir install-suid; \
187                         fi; \
188                 done \
189         fi
190         @echo "done"
191
192 install-ss:
193         @for dir in $(BIN_DIRS); do \
194                 if [ -e $$dir/Makefile ]; then \
195                         $(MAKE) -C $$dir install-ss; \
196                 fi; \
197         done
198
199         @if [ "$(GTK_LIBS)" ]; then \
200                 for dir in $(GTK_DIRS); do \
201                         if [ -e $$dir/Makefile ]; then \
202                                 $(MAKE) -C $$dir install-ss; \
203                         fi; \
204                 done \
205         fi
206         @echo "done"
207
208 .PHONY: all install clean distclean dep depend install-docs