24
|
1 #
|
|
2 # mcabber Makefile
|
|
3 #
|
|
4
|
|
5
|
|
6 #
|
|
7 # Available options:
|
|
8 #
|
|
9 # Environment variables:
|
|
10 # CPU optimize for the given processor.
|
|
11 # default = pentium
|
|
12 # DEBUG=1 disable optimizations and build for debug
|
|
13 # default = no
|
28
|
14 # GNU99=1 use GNU99 extensions
|
|
15 # default = no
|
24
|
16 #
|
|
17 # Targets:
|
|
18 # all: build executable
|
|
19 # clean: remove object files
|
|
20 # realclean: remove all generated files
|
|
21 # install: build & install
|
|
22 # dep: create dependencies
|
|
23 #
|
|
24
|
|
25
|
|
26 .PHONY: all clean realclean install
|
|
27 # dep
|
|
28
|
|
29 CPU ?= i386
|
|
30 JCLIENT = mcabber
|
28
|
31 ifndef CC
|
24
|
32 CC = gcc
|
28
|
33 endif
|
24
|
34 CFLAGS = -Wall -W -pedantic
|
28
|
35 LD = $(CC)
|
29
|
36 LDLIBS = -lncurses -lpanel -L../libjabber -L../connwrap -llibjabber -lconnwrap -lssl
|
24
|
37
|
|
38 ifeq ($(DEBUG),1)
|
|
39 CFLAGS += -O0 -g -DDEBUG=1
|
|
40 else
|
|
41 CFLAGS += -O2 -mcpu=$(CPU)
|
|
42 LDFLAGS = -s
|
|
43 endif
|
|
44
|
28
|
45 ifeq ($(GNU99),1)
|
|
46 CFLAGS += -std=gnu99 -D_GNU_SOURCE
|
|
47 endif
|
|
48
|
24
|
49 CP = cp -f
|
|
50
|
|
51 SOURCES = \
|
|
52 main.c \
|
|
53 screen.c \
|
|
54 utils.c \
|
|
55 buddies.c \
|
|
56 parsecfg.c \
|
29
|
57 jabglue.c \
|
24
|
58 server.c \
|
|
59 socket.c \
|
|
60 lang.c \
|
|
61 utf8.c
|
|
62
|
|
63 OBJECTS = $(SOURCES:.c=.o)
|
|
64
|
|
65 .c.o:
|
|
66 $(CC) -o $@ $(CFLAGS) -c $<
|
|
67
|
|
68 all: $(JCLIENT)
|
|
69
|
|
70 $(JCLIENT): $(OBJECTS)
|
|
71 $(LD) -o $@ $(LDFLAGS) $^ $(LDLIBS)
|
|
72
|
|
73 clean:
|
|
74 -$(RM) *~
|
|
75 -$(RM) $(JCLIENT)
|
|
76 -$(RM) $(OBJECTS)
|
|
77 # -$(RM) depend
|
|
78
|
|
79 realclean: clean
|
|
80 -$(RM) $(JCLIENT)
|
|
81
|
|
82 install: all
|
28
|
83 $(CP) $(JCLIENT) /usr/local/bin/$(JCLIENT)
|
24
|
84
|
|
85 #dep: $(SOURCES)
|
|
86 # makedepend -f- -Ylydialog -- $(CFLAGS) -- $(SOURCES) > depend
|
|
87
|
|
88 #-include depend
|