1# Makefile.in -- input for the src directory's Makefile
2# $Id: Makefile.in,v 1.42 2003/08/14 07:12:53 jsh Exp $
3#
4# Copyright (C) 1999 John Harper <john@dcs.warwick.ac.uk>
5#
6# This file is part of sawfish.
7#
8# sawfish is free software; you can redistribute it and/or modify it
9# under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2, or (at your option)
11# any later version.
12#
13# sawfish is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with sawfish; see the file COPYING.  If not, write to
20# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21
22include ../Makedefs
23
24top_builddir=..
25top_srcdir=@top_srcdir@
26srcdir=@srcdir@
27
28SRCS :=	colors.c cursors.c display.c events.c fonts.c frames.c flippers.c \
29	functions.c images.c keys.c main.c multihead.c pixmap-cache.c \
30	property-cache.c server.c session.c stacking-list.c windows.c
31OBJS := $(SRCS:.c=.o)
32
33DL_SRCS := gradient.c x.c selection.c
34DL_OBJS := $(DL_SRCS:%.c=%.la) client.la
35DL_DSTS = sawfish/wm/util/gradient.la sawfish/wm/util/x.la sawfish/wm/util/selection.la
36DL_DIRS = sawfish/wm/util
37
38INSTALL_HDRS = sawfish.h sawfish_subrs.h libclient.h server.h keys.h build.h
39
40override CFLAGS := $(CFLAGS) $(REP_CFLAGS) $(IMAGE_CFLAGS) $(X11_CFLAGS) $(PANGO_CFLAGS)
41
42all : sawfish libclient.o $(DL_OBJS) .libexec gtk-style
43
44sawfish : $(OBJS) $(LIBOBJS)
45	$(LIBTOOL) --mode=link --tag=CC $(CC) -export-dynamic $(LDFLAGS) \
46	  -o sawfish $(OBJS) $(LIBOBJS) $(REP_LIBS) $(PANGO_LIBS) \
47	  $(IMAGE_LIBS) $(X11_LIBS) $(EXTRA_X11_LIBS) $(LIBS) $(XRANDR_LIBS)
48
49%.la : %.lo
50	$(rep_DL_LD) $(LDFLAGS) -o $@ $<
51
52libclient_.lo : libclient.c
53	$(LIBTOOL) --mode=compile --tag=CC $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
54
55client.la : client.lo libclient_.lo
56	$(rep_DL_LD) $(LDFLAGS) -o $@ $^ $(X11_LIBS) $(REP_LIBS) $(LIBS) $(XRANDR_LIBS)
57
58gtk-style : gtk-style.c
59	$(CC) $(CFLAGS) $(CPPFLAGS) $(GTK_CFLAGS) $(LDFLAGS) -o $@ $< $(GTK_LIBS) $(LIBS) $(XRANDR_LIBS)
60
61install : all installdirs
62	for p in sawfish; do \
63	  $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)${bindir}; \
64	done
65	$(rep_DL_INSTALL) gtk-style $(DESTDIR)${sawfishexecdir}
66	$(foreach x,$(DL_DSTS),\
67	  $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) \
68	  $(notdir $(x)) $(DESTDIR)$(sawfishexecdir)/$(dir $(x));)
69	$(rep_INSTALL_ALIASES) -c $(srcdir) $(DESTDIR)$(sawfishexecdir)
70	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) client.la $(DESTDIR)$(repexecdir)/sawfish/
71	for i in $(INSTALL_HDRS); do \
72	  $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/sawfish/; \
73	done
74	$(INSTALL_DATA) $(top_srcdir)/config.h $(DESTDIR)$(includedir)/sawfish/sawfish_config.h
75
76uninstall :
77	for p in sawfish; do \
78	  $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)${bindir}/$$p; \
79	done
80	rm -f $(DESTDIR)$(bindir)/sawfish-client
81	$(rep_DL_UNINSTALL) -f $(DESTDIR)${sawfishexecdir}/gtk-style
82	for dl in $(DL_DSTS); do \
83	  $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)${sawfishexecdir}/$$dl; \
84	done
85	$(rep_DL_UNINSTALL) -f $(DESTDIR)$(repexecdir)/sawfish/client.la
86	rm -rf $(DESTDIR)$(includedir)/sawfish/
87
88installdirs : $(top_srcdir)/mkinstalldirs
89	$(SHELL) $< $(DESTDIR)$(bindir) $(DESTDIR)$(repexecdir)/sawfish \
90	  $(foreach x,$(DL_DIRS),$(DESTDIR)$(sawfishexecdir)/$(x)) \
91	  $(DESTDIR)$(includedir)/sawfish/
92
93.libexec : $(DL_OBJS)
94	$(SHELL) $(srcdir)/fake-libexec
95
96clean :
97	rm -f *~ *.o *.lo *.la *.jlc build.h core \
98		.*.d sawfish sawfish-about.jl \
99		 gtk-style
100	rm -rf .libs .libexec
101
102distclean : clean
103	rm -f Makefile
104
105-include $(SRCS:%.c=.%.d) $(DL_SRCS:%.c=.%.d)
106
107.PHONY: all clean install uninstall distclean
108