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) |
35
|
36 |
LDLIBS = -lncurses -lpanel -lssl -L../libjabber -L../connwrap -llibjabber -lconnwrap |
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 |
lang.c \ |
|
59 |
utf8.c |
|
60 |
|
|
61 |
OBJECTS = $(SOURCES:.c=.o) |
|
62 |
|
|
63 |
.c.o: |
|
64 |
$(CC) -o $@ $(CFLAGS) -c $< |
|
65 |
|
|
66 |
all: $(JCLIENT) |
|
67 |
|
|
68 |
$(JCLIENT): $(OBJECTS) |
|
69 |
$(LD) -o $@ $(LDFLAGS) $^ $(LDLIBS) |
|
70 |
|
|
71 |
clean: |
|
72 |
-$(RM) *~ |
|
73 |
-$(RM) $(JCLIENT) |
|
74 |
-$(RM) $(OBJECTS) |
|
75 |
# -$(RM) depend |
|
76 |
|
|
77 |
realclean: clean |
|
78 |
-$(RM) $(JCLIENT) |
|
79 |
|
|
80 |
install: all |
28
|
81 |
$(CP) $(JCLIENT) /usr/local/bin/$(JCLIENT) |
24
|
82 |
|
|
83 |
#dep: $(SOURCES) |
|
84 |
# makedepend -f- -Ylydialog -- $(CFLAGS) -- $(SOURCES) > depend |
|
85 |
|
|
86 |
#-include depend |