First version, development moved to 5110-connected machine
[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/data.a $(TOPDIR)/common/common.a cleanup.o # $(TOPDIR)/common/gsm-filetypes.o
26         $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ -o $@
27 #-L../common -lcommon ##$(LOADLIBES) $(LDLIBS)
28
29 $(TOPDIR)/common/common.a: 
30         $(MAKE) -C $(TOPDIR)/common common.a
31
32 $(TOPDIR)/common/data.a:
33         $(MAKE) -C $(TOPDIR)/common data.a
34
35 $(TOPDIR)/common/gsm-filetypes.o: 
36         $(MAKE) -C $(TOPDIR)/common gsm-filetypes.o
37
38 $(TOPDIR)/getopt/libgetopt.a:
39         $(MAKE) -C $(TOPDIR)/getopt
40
41 $(TOPDIR)/common/libmygnokii.so:
42         $(MAKE) -C $(TOPDIR)/common makelib
43         
44 gnokiilib: $(OBJS) $(TOPDIR)/common/libmygnokii.so
45         $(CC) $(LDFLAGS) $(TARGET_ARCH) $(OBJS) -L$(TOPDIR)/common -lmygnokii $(LOADLIBES) $(LDLIBS) -o $@
46
47 makelib: gnokiilib
48
49 clean:
50         $(RM) $(OBJS) cleanup.o *~ depend gnokii gnokiilib *.exe core *.bak
51
52 install: all
53         $(INSTALL) -d $(bindir)
54         $(INSTALL) gnokii $(bindir)
55         $(INSTALL) gnokiilib $(bindir)/gnokii
56
57 install-strip: all
58         $(INSTALL) -d $(bindir)
59         $(INSTALL) -s gnokii $(bindir)
60         $(INSTALL) -s gnokiilib $(bindir)/gnokii
61         @echo "done"
62
63 install-suid: all
64         @if [ -z "/bin/grep -e '^gnokii:' /etc/group" ]; then \
65                 /usr/sbin/groupadd gnokii; \
66         fi
67         $(INSTALL) -d $(bindir)
68         $(INSTALL) -o root -g gnokii -m 0750 gnokii $(bindir)
69         $(INSTALL) -o root -g gnokii -m 0750 gnokiilib $(bindir)/gnokii
70         @echo
71
72 install-ss: all
73         @if [ -z "/bin/grep -e '^gnokii:' /etc/group" ]; then \
74                 /usr/sbin/groupadd gnokii; \
75         fi
76         $(INSTALL) -d $(bindir)
77         $(INSTALL) -o root -g gnokii -m 0750 -s gnokii $(bindir)
78         $(INSTALL) -o root -g gnokii -m 0750 -s gnokiilib $(bindir)/gnokii
79         @echo
80
81 depend dep:
82         $(CC) $(CFLAGS) -MM *.c >depend
83
84 ifeq (depend,$(wildcard depend))
85 include depend
86 endif
87
88 .PHONY: all install clean dep depend