http://marcin-wiacek.fkn.pl/english/zips/mygnokii.tar.gz
[gnokii.git] / gnokii / Makefile
1
2 #
3 # Makefile for the GNOKII tool suite.
4 #
5
6 TOPDIR=..
7 include $(TOPDIR)/Makefile.global
8
9
10 CFLAGS  += $(PTHREAD_CFLAGS)
11 LDLIBS  += $(PTHREAD_LIBS)
12
13 ifdef XPM_LIBS
14     LDLIBS += $(XPM_LIBS)
15 endif
16
17 OBJS =  gnokii.o
18
19 ifdef OWN_GETOPT
20     OBJS += $(TOPDIR)/getopt/libgetopt.a
21 endif
22
23 all: gnokii
24
25 gnokii: $(OBJS) $(TOPDIR)/common/COMMON.o $(TOPDIR)/common/gsm-filetypes.o
26         $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@
27
28 $(TOPDIR)/common/COMMON.o: 
29         $(MAKE) -C $(TOPDIR)/common COMMON.o
30
31 $(TOPDIR)/common/gsm-filetypes.o: 
32         $(MAKE) -C $(TOPDIR)/common gsm-filetypes.o
33
34 $(TOPDIR)/getopt/libgetopt.a:
35         $(MAKE) -C $(TOPDIR)/getopt
36
37 $(TOPDIR)/common/libmygnokii.so:
38         $(MAKE) -C $(TOPDIR)/common makelib
39         
40 gnokiilib: $(OBJS) $(TOPDIR)/common/libmygnokii.so
41         $(CC) $(LDFLAGS) $(TARGET_ARCH) $(OBJS) -L$(TOPDIR)/common -lmygnokii $(LOADLIBES) $(LDLIBS) -o $@
42
43 makelib: gnokiilib
44
45 clean:
46         $(RM) $(OBJS) *~ depend gnokii gnokiilib *.exe core *.bak
47
48 install: all
49         $(INSTALL) -d $(bindir)
50         $(INSTALL) gnokii $(bindir)
51         $(INSTALL) gnokiilib $(bindir)/gnokii
52
53 install-strip: all
54         $(INSTALL) -d $(bindir)
55         $(INSTALL) -s gnokii $(bindir)
56         $(INSTALL) -s gnokiilib $(bindir)/gnokii
57         @echo "done"
58
59 install-suid: all
60         @if [ -z "/bin/grep -e '^gnokii:' /etc/group" ]; then \
61                 /usr/sbin/groupadd gnokii; \
62         fi
63         $(INSTALL) -d $(bindir)
64         $(INSTALL) -o root -g gnokii -m 0750 gnokii $(bindir)
65         $(INSTALL) -o root -g gnokii -m 0750 gnokiilib $(bindir)/gnokii
66         @echo
67
68 install-ss: all
69         @if [ -z "/bin/grep -e '^gnokii:' /etc/group" ]; then \
70                 /usr/sbin/groupadd gnokii; \
71         fi
72         $(INSTALL) -d $(bindir)
73         $(INSTALL) -o root -g gnokii -m 0750 -s gnokii $(bindir)
74         $(INSTALL) -o root -g gnokii -m 0750 -s gnokiilib $(bindir)/gnokii
75         @echo
76
77 depend dep:
78         $(CC) $(CFLAGS) -MM *.c >depend
79
80 ifeq (depend,$(wildcard depend))
81 include depend
82 endif
83
84 .PHONY: all install clean dep depend