clean target: +missing hello.o
[gnokii.git] / gnokii / Makefile
1
2 #
3 # Makefile for the GNOKII tool suite.
4 #
5
6 TOPDIR=..
7 include $(TOPDIR)/Makefile.global
8
9 STACKSIZE = 150000
10
11 CFLAGS  += $(PTHREAD_CFLAGS)
12 LDLIBS  += $(PTHREAD_LIBS)
13
14 ifdef XPM_LIBS
15     LDLIBS += $(XPM_LIBS)
16 endif
17
18 OBJS =  gnokii.o
19
20 ifdef OWN_GETOPT
21     OBJS += $(TOPDIR)/getopt/libgetopt.a
22 endif
23
24 all: gnokii
25
26 gnokii: $(OBJS) $(TOPDIR)/common/data.a $(TOPDIR)/common/common.a cleanup.o # $(TOPDIR)/common/gsm-filetypes.o
27         $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ -o $@
28 ifneq "" "$(findstring -DUCCOMPAT,$(CPPFLAGS))"
29         /opt/uClinux/m68k-pic-coff/bin/coff2flt -o gnokii -s $(STACKSIZE) gnokii.coff
30 endif
31
32 hello: hello.o cleanup.o
33         $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ -o $@
34
35 cleanup.o: cleanup.c
36         $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $<
37
38 $(TOPDIR)/common/common.a: 
39         $(MAKE) -C $(TOPDIR)/common common.a
40
41 $(TOPDIR)/common/data.a:
42         $(MAKE) -C $(TOPDIR)/common data.a
43
44 $(TOPDIR)/common/gsm-filetypes.o: 
45         $(MAKE) -C $(TOPDIR)/common gsm-filetypes.o
46
47 $(TOPDIR)/getopt/libgetopt.a:
48         $(MAKE) -C $(TOPDIR)/getopt
49
50 $(TOPDIR)/common/libmygnokii.so:
51         $(MAKE) -C $(TOPDIR)/common makelib
52         
53 gnokiilib: $(OBJS) $(TOPDIR)/common/libmygnokii.so
54         $(CC) $(LDFLAGS) $(TARGET_ARCH) $(OBJS) -L$(TOPDIR)/common -lmygnokii $(LOADLIBES) $(LDLIBS) -o $@
55
56 makelib: gnokiilib
57
58 clean:
59         $(RM) $(OBJS) cleanup.o hello.o *~ depend gnokii gnokiilib *.exe core *.bak
60
61 install: all
62         $(INSTALL) -d $(bindir)
63         $(INSTALL) gnokii $(bindir)
64         $(INSTALL) gnokiilib $(bindir)/gnokii
65
66 install-strip: all
67         $(INSTALL) -d $(bindir)
68         $(INSTALL) -s gnokii $(bindir)
69         $(INSTALL) -s gnokiilib $(bindir)/gnokii
70         @echo "done"
71
72 install-suid: 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 gnokii $(bindir)
78         $(INSTALL) -o root -g gnokii -m 0750 gnokiilib $(bindir)/gnokii
79         @echo
80
81 install-ss: all
82         @if [ -z "/bin/grep -e '^gnokii:' /etc/group" ]; then \
83                 /usr/sbin/groupadd gnokii; \
84         fi
85         $(INSTALL) -d $(bindir)
86         $(INSTALL) -o root -g gnokii -m 0750 -s gnokii $(bindir)
87         $(INSTALL) -o root -g gnokii -m 0750 -s gnokiilib $(bindir)/gnokii
88         @echo
89
90 depend dep:
91         $(CC) $(CFLAGS) -MM *.c >depend
92
93 ifeq (depend,$(wildcard depend))
94 include depend
95 endif
96
97 .PHONY: all install clean dep depend