default platform: i386 (not m68k)
[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 #uClinux:
42 GTK_LIBS=
43
44 PO_DIR   =      po
45 DOCS_DIR =      Docs
46
47 all: $(DIRS)
48         @if [ "x$(USE_NLS)" = xyes ]; then \
49                 $(MAKE) -C $(PO_DIR); \
50         fi
51
52         @if [ "$(GTK_LIBS)" ]; then \
53                 for dir in $(GTK_DIRS); do \
54                     if [ -e $$dir/Makefile ]; then \
55                         $(MAKE) -C $$dir; \
56                     fi; \
57                 done \
58         fi
59         @echo "done"
60
61 makelib:
62         @for dir in $(DIRS); do \
63             if [ -e $$dir/Makefile ]; then \
64                 $(MAKE) -C $$dir makelib; \
65             fi; \
66         done
67         @if [ "x$(USE_NLS)" = xyes ]; then \
68                 $(MAKE) -C $(PO_DIR) makelib; \
69         fi
70
71         @if [ "$(GTK_LIBS)" ]; then \
72                 for dir in $(GTK_DIRS); do \
73                     if [ -e $$dir/Makefile ]; then \
74                         $(MAKE) -C $$dir makelib; \
75                     fi; \
76                 done \
77         fi
78         @echo "done"
79
80 dummy:
81
82 $(DIRS): dummy
83         $(MAKE) -C $@
84
85 clean:
86         $(RM) *~ *.orig *.rej include/*~ include/*.orig include/*.rej
87         @for dir in $(DIRS); do \
88             if [ -e $$dir/Makefile ]; then \
89                 $(MAKE) -C $$dir clean; \
90             fi; \
91         done
92         @if [ "x$(USE_NLS)" = xyes ]; then \
93                 $(MAKE) -C $(PO_DIR) clean; \
94         fi
95
96 ifdef OWN_GETOPT
97                 $(MAKE) -C getopt clean
98 endif
99
100         @if [ "$(GTK_LIBS)" ]; then \
101                 for dir in $(GTK_DIRS); do \
102                     if [ -e $$dir/Makefile ]; then \
103                         $(MAKE) -C $$dir clean; \
104                     fi; \
105                 done \
106         fi
107
108         $(MAKE) -C Docs clean
109
110         @echo "done"
111
112 distclean:      clean
113         @if [ -e $(PO_DIR)/Makefile ]; then \
114                 $(MAKE) -C $(PO_DIR) distclean; \
115         fi
116         $(RM) Makefile.global config.cache config.log config.status \
117                 include/config.h \
118                 include/config.h.in \
119                 packaging/RedHat/gnokii.spec \
120                 packaging/Slackware/SlackBuild \
121                 po/Makefile.in \
122                 debian
123
124 dep:
125         @for dir in $(DIRS); do \
126             if [ -e $$dir/Makefile ]; then \
127                 $(MAKE) -C $$dir dep; \
128             fi; \
129         done
130
131         @if [ "$(GTK_LIBS)" ]; then \
132                 for dir in $(GTK_DIRS); do \
133                     if [ -e $$dir/Makefile ]; then \
134                         $(MAKE) -C $$dir dep; \
135                     fi; \
136                 done \
137         fi
138         @echo "done"
139
140 install:
141         @for dir in $(DIRS); do \
142             if [ -e $$dir/Makefile ]; then \
143                 $(MAKE) -C $$dir install; \
144             fi; \
145         done
146         @if [ "x$(USE_NLS)" = xyes ]; then \
147                 $(MAKE) -C $(PO_DIR) install; \
148         fi
149
150         @if [ "$(GTK_LIBS)" ]; then \
151                 for dir in $(GTK_DIRS); do \
152                     if [ -e $$dir/Makefile ]; then \
153                         $(MAKE) -C $$dir install; \
154                     fi; \
155                 done \
156         fi
157         @echo "done"
158
159 install-docs:
160         $(MAKE) -C $(DOCS_DIR) install
161         @echo "done"
162
163 install-strip:
164         @for dir in $(BIN_DIRS); do \
165                 if [ -e $$dir/Makefile ]; then \
166                         $(MAKE) -C $$dir install-strip; \
167                 fi; \
168         done
169
170         @if [ "$(GTK_LIBS)" ]; then \
171                 @for dir in $(GTK_DIRS); do \
172                         if [ -e $$dir/Makefile ]; then \
173                                 $(MAKE) -C $$dir install-strip; \
174                         fi; \
175                 done \
176         fi
177         @echo "done"
178
179 install-suid:
180         @for dir in $(BIN_DIRS); do \
181                 if [ -e $$dir/Makefile ]; then \
182                         $(MAKE) -C $$dir install-suid; \
183                 fi; \
184         done
185         @if [ "$(GTK_LIBS)" ]; then \
186                 @for dir in $(GTK_DIRS); do \
187                         if [ -e $$dir/Makefile ]; then \
188                                 $(MAKE) -C $$dir install-suid; \
189                         fi; \
190                 done \
191         fi
192         @echo "done"
193
194 install-ss:
195         @for dir in $(BIN_DIRS); do \
196                 if [ -e $$dir/Makefile ]; then \
197                         $(MAKE) -C $$dir install-ss; \
198                 fi; \
199         done
200
201         @if [ "$(GTK_LIBS)" ]; then \
202                 for dir in $(GTK_DIRS); do \
203                         if [ -e $$dir/Makefile ]; then \
204                                 $(MAKE) -C $$dir install-ss; \
205                         fi; \
206                 done \
207         fi
208         @echo "done"
209
210 .PHONY: all install clean distclean dep depend install-docs