warning
[rofl0r-ixchat.git] / Makefile
blob06159eafd772465ccae9dac47297119b55d2cd0f
1 # Use config.mak to override any of the following variables.
2 # Do not make changes here.
5 exec_prefix = /usr/local
6 bindir = $(exec_prefix)/bin
8 prefix = /usr/local/
9 includedir = $(prefix)/include
10 libdir = $(prefix)/lib
12 SRCS = $(sort $(wildcard src/common/*.c))
13 SRCS_FE_GTK = $(sort $(wildcard src/fe-gtk/*.c))
14 SRCS_FE_TEXT = $(sort $(wildcard src/fe-text/*.c))
15 OBJS = $(SRCS:.c=.o)
16 OBJS_FE_GTK = $(SRCS_FE_GTK:.c=.o)
17 OBJS_FE_TEXT = $(SRCS_FE_TEXT:.c=.o)
19 CFLAGS += -Os
20 HOSTCC ?= $(CC)
22 ALL_TOOLS=ixchat
24 PIXMAP=src/pixmaps/inline_pngs.h
25 _PNGS = message.png highlight.png fileoffer.png book.png hop.png op.png purple.png red.png voice.png
26 pixsrcdir=src/pixmaps
27 PNGS = $(pixsrcdir)/message.png $(pixsrcdir)/highlight.png $(pixsrcdir)/fileoffer.png \
28 $(pixsrcdir)/book.png $(pixsrcdir)/hop.png $(pixsrcdir)/op.png $(pixsrcdir)/purple.png \
29 $(pixsrcdir)/red.png $(pixsrcdir)/voice.png
31 PIXMAPLIST = traymsgpng $(pixsrcdir)/message.png \
32 trayhilightpng $(pixsrcdir)/highlight.png \
33 trayfilepng $(pixsrcdir)/fileoffer.png \
34 bookpng $(pixsrcdir)/book.png \
35 hoppng $(pixsrcdir)/hop.png \
36 oppng $(pixsrcdir)/op.png \
37 purplepng $(pixsrcdir)/purple.png \
38 redpng $(pixsrcdir)/red.png \
39 voicepng $(pixsrcdir)/voice.png \
40 xchatpng $(pixsrcdir)/../../xchat.png
42 PERL_HEADERS = plugins/perl/irc.pm.h plugins/perl/xchat.pm.h
43 PERL_HEADERS_INPUT = plugins/perl/lib/IRC.pm \
44 plugins/perl/lib/Xchat.pm \
45 plugins/perl/lib/Xchat/Embed.pm \
46 plugins/perl/lib/Xchat/List/Network.pm \
47 plugins/perl/lib/Xchat/List/Network/Entry.pm\
48 plugins/perl/lib/Xchat/List/Network/AutoJoin.pm
50 TEXT_HEADERS = src/common/textevents.h src/common/textenums.h
52 INSTALL_FLAGS=-D -m
54 -include config.mak
56 all: $(ALL_TOOLS) $(PLUGINS)
58 install: $(ALL_TOOLS:%=$(DESTDIR)$(bindir)/%) install-plugins
60 install-plugins: $(PLUGINS:%=$(DESTDIR)$(libdir)/xchat/plugins/%)
62 $(DESTDIR)$(libdir)/xchat/plugins/%: %
63 install -d $(DESTDIR)$(libdir)/xchat/plugins
64 install $(INSTALL_FLAGS) 644 $< $@
66 src/make-te: src/make-te.c
67 $(HOSTCC) $< -o $@
69 $(TEXT_HEADERS): src/common/textevents.in src/make-te
70 src/make-te < src/common/textevents.in 2>src/common/textenums.h 1>src/common/textevents.h
72 $(PERL_HEADERS): $(PERL_HEADERS_INPUT)
73 plugins/perl/generate_header
75 tcl.so: plugins/tcl/tcl.o
76 $(CC) $< -shared -rdynamic -o $@ $(LDFLAGS) $(TCL_LDFLAGS)
78 plugins/tcl/tcl.o: plugins/tcl/tclplugin.c
79 $(CC) $(CFLAGS) $(TCL_CFLAGS) -fPIC -c $< -o $@
81 python.so: plugins/python/python.o
82 $(CC) $< -shared -rdynamic -o $@ $(LDFLAGS) $(PY_LDFLAGS)
84 plugins/python/python.o: plugins/python/python.c
85 $(CC) $(CFLAGS) $(PY_CFLAGS) -fPIC -c $< -o $@
87 perl.so: plugins/perl/perl.o
88 $(CC) $< -shared -rdynamic -o $@ $(LDFLAGS) $(PERL_LDFLAGS)
90 plugins/perl/perl.o: plugins/perl/perl.c $(PERL_HEADERS)
91 $(CC) $(CFLAGS) $(PERL_CFLAGS) -fPIC -c $< -o $@
93 ixchat: $(OBJS) $(OBJS_FE_GTK)
94 $(CC) $(LDFLAGS) -rdynamic -o $@ $(OBJS) $(OBJS_FE_GTK)
96 ixchat-text: $(OBJS) $(OBJS_FE_TEXT)
97 $(CC) $(LDFLAGS) -rdynamic -o $@ $(OBJS) $(OBJS_FE_TEXT)
99 clean:
100 rm -f $(OBJS)
101 rm -f $(OBJS_FE_GTK)
102 rm -f $(OBJS_FE_TEXT)
103 rm -f $(PIXMAP)
104 rm -f $(ALL_TOOLS)
105 rm -f $(PERL_HEADERS)
106 rm -f $(TEXT_HEADERS)
107 rm -f $(PLUGINS)
108 rm -f plugins/perl/*.o
109 rm -f plugins/python/*.o
110 rm -f plugins/tcl/*.o
112 $(PIXMAP): $(PNGS)
113 $(PIXMAPCONVERT) --raw --build-list $(PIXMAPLIST) > $(PIXMAP)
115 %.o: %.c $(PIXMAP) $(TEXT_HEADERS)
116 $(CC) $(CFLAGS) -c -o $@ $<
118 $(DESTDIR)$(bindir)/%: %
119 install -d $(DESTDIR)$(bindir)
120 install $(INSTALL_FLAGS) 755 $< $@
122 $(DESTDIR)$(prefix)/%: %
123 install $(INSTALL_FLAGS) 644 $< $@
125 .PHONY: all clean install