cfef684cbf2df55d1b555977746869c94de382d6
[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 utils
22 endif
23
24 DIRS =  common/phones \
25         common/links \
26         common/devices \
27         common/data \
28         common \
29         $(BIN_DIRS)
30
31 GTK_DIRS =  xgnokii
32
33 PO_DIR   =      po
34 DOCS_DIR =      Docs
35
36 all: $(DIRS)
37         @if [ "x$(USE_NLS)" = xyes ]; then \
38                 $(MAKE) -C $(PO_DIR); \
39         fi
40
41         @if [ "$(GTK_LIBS)" ]; then \
42                 for dir in $(GTK_DIRS); do \
43                     if [ -e $$dir/Makefile ]; then \
44                         $(MAKE) -C $$dir; \
45                     fi; \
46                 done \
47         fi
48         @echo "done"
49
50 dummy:
51
52 $(DIRS): dummy
53         $(MAKE) -C $@
54
55 clean:
56         $(RM) *~ *.orig *.rej include/*~ include/*.orig include/*.rej
57         @for dir in $(DIRS); do \
58             if [ -e $$dir/Makefile ]; then \
59                 $(MAKE) -C $$dir clean; \
60             fi; \
61         done
62         @if [ "x$(USE_NLS)" = xyes ]; then \
63                 $(MAKE) -C $(PO_DIR) clean; \
64         fi
65
66 ifdef OWN_GETOPT
67                 $(MAKE) -C getopt clean
68 endif
69
70         @if [ "$(GTK_LIBS)" ]; then \
71                 for dir in $(GTK_DIRS); do \
72                     if [ -e $$dir/Makefile ]; then \
73                         $(MAKE) -C $$dir clean; \
74                     fi; \
75                 done \
76         fi
77
78         $(MAKE) -C Docs clean
79
80         @echo "done"
81
82 distclean:      clean
83         @if [ -e $(PO_DIR)/Makefile ]; then \
84                 $(MAKE) -C $(PO_DIR) distclean; \
85         fi
86         $(RM) Makefile.global config.cache config.log config.status \
87                 include/config.h \
88                 include/config.h.in \
89                 packaging/RedHat/gnokii.spec \
90                 packaging/Slackware/SlackBuild \
91                 po/Makefile.in \
92                 debian
93         $(RM) `$(FIND) . -name "*~"`
94         @echo "done"
95
96 dep:
97         @for dir in $(DIRS); do \
98             if [ -e $$dir/Makefile ]; then \
99                 $(MAKE) -C $$dir dep; \
100             fi; \
101         done
102
103         @if [ "$(GTK_LIBS)" ]; then \
104                 for dir in $(GTK_DIRS); do \
105                     if [ -e $$dir/Makefile ]; then \
106                         $(MAKE) -C $$dir dep; \
107                     fi; \
108                 done \
109         fi
110         @echo "done"
111
112 install: all
113         @for dir in $(DIRS); do \
114             if [ -e $$dir/Makefile ]; then \
115                 $(MAKE) -C $$dir install; \
116             fi; \
117         done
118         @if [ "x$(USE_NLS)" = xyes ]; then \
119                 $(MAKE) -C $(PO_DIR) install; \
120         fi
121
122         @if [ "$(GTK_LIBS)" ]; then \
123                 for dir in $(GTK_DIRS); do \
124                     if [ -e $$dir/Makefile ]; then \
125                         $(MAKE) -C $$dir install; \
126                     fi; \
127                 done \
128         fi
129         @echo "done"
130
131 install-docs:
132         $(MAKE) -C $(DOCS_DIR) install
133         @echo "done"
134
135 install-strip:
136         @for dir in $(BIN_DIRS); do \
137                 if [ -e $$dir/Makefile ]; then \
138                         $(MAKE) -C $$dir install-strip; \
139                 fi; \
140         done
141
142         @if [ "$(GTK_LIBS)" ]; then \
143                 @for dir in $(GTK_DIRS); do \
144                         if [ -e $$dir/Makefile ]; then \
145                                 $(MAKE) -C $$dir install-strip; \
146                         fi; \
147                 done \
148         fi
149         @echo "done"
150
151 install-suid:
152         @for dir in $(BIN_DIRS); do \
153                 if [ -e $$dir/Makefile ]; then \
154                         $(MAKE) -C $$dir install-suid; \
155                 fi; \
156         done
157         @if [ "$(GTK_LIBS)" ]; then \
158                 @for dir in $(GTK_DIRS); do \
159                         if [ -e $$dir/Makefile ]; then \
160                                 $(MAKE) -C $$dir install-suid; \
161                         fi; \
162                 done \
163         fi
164         @echo "done"
165
166 install-ss:
167         @for dir in $(BIN_DIRS); do \
168                 if [ -e $$dir/Makefile ]; then \
169                         $(MAKE) -C $$dir install-ss; \
170                 fi; \
171         done
172
173         @if [ "$(GTK_LIBS)" ]; then \
174                 for dir in $(GTK_DIRS); do \
175                         if [ -e $$dir/Makefile ]; then \
176                                 $(MAKE) -C $$dir install-ss; \
177                         fi; \
178                 done \
179         fi
180         @echo "done"
181
182 .PHONY: all install clean distclean dep depend install-docs