1
# -*-makefile-*- (gpm/src)
3
# Copyright 1994,1997 rubini@linux.it
4
# Copyright 1997 dickey@clark.net
5
# Copyright (C) 1998 Ian Zimmerman <itz@rahul.net>
6
# Copyright (C) 2001-2008 Nico Schottelius <nico-gpm2008 at schottelius.org>
9
srcdir = /home/peter/devel/debian/status-support/gpm-1.20.4/src
12
include $(top_builddir)/Makefile.include
14
# Main portion: regular build rules
16
GSRC = mice.c twiddler.c synaptics.c \
17
daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \
18
daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \
19
daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \
20
daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \
21
daemon/header.c daemon/main.c daemon/old_main.c \
22
daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \
23
generic/isodigit.c generic/getsym.c \
24
daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \
25
daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\
26
daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \
27
daemon/usage.c daemon/check_uniqueness.c \
28
daemon/startup.c daemon/wait_text.c
30
GOBJ = $(GSRC:.c=.o) report.o tools.o
32
LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c
34
LOBJ = $(LSRC:.c=.o) tools.o lib/libcurses.o
38
HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h
40
PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c \
41
prog/display-buttons.c prog/display-coords.c
43
POBJ = $(PSRC:.c=.o) prog/gpm-root.o
47
SRCS = $(GSRC) $(LSRC) $(PSRC) report.c
49
DEFS = -DHAVE_CONFIG_H
55
# allow CFLAGS to be overriden from make command line
56
# ideally one would never have to write this rule again, but the GNU
57
# makefile standards are at cross-purposes: CFLAGS is reserved for
58
# user-overridable flags, but it's also all the implicit rule looks at.
60
# the prog rules are not very clean...
62
$(CC) -Iheaders -I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\"" $(CPPFLAGS) -Wall -g -D_REENTRANT -O2 $(CFLAGS) -c -o $@ $<
65
$(CC) -L$(srcdir) $(LDFLAGS) -o $@ $^ $(LIBS)
68
$(CC) -I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\"" $(CPPFLAGS) -Wall -g -D_REENTRANT -O2 $(CFLAGS) -c -o $@ $<
71
$(CC) -I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\"" $(CPPFLAGS) -DPIC -fPIC -Wall -g -D_REENTRANT -O2 $(CFLAGS) -c -o $@ $<
74
$(CC) -L$(srcdir) $(LDFLAGS) -o $@ $^ $(LIBS)
76
# old, unused, but good rule [dependings]
78
# $(SHELL) -ec '$(CC) -M $(GPMCPPFLAGS) $(CPPFLAGS) $< \
79
# | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@'
82
all: gpm lib/libgpm.so.2 lib/libgpm.a $(PROG)
85
$(CC) -L$(srcdir) $(LDFLAGS) -o $@ $(GOBJ) $(LIBS) -lm
87
# construct dependings of sourcefiles and link sourcefiles
88
$(DEPFILE) dep: prog/gpm-root.c
89
# make links in subdirectories
90
-@for cfiledirs in prog lib; do $(MKDIR) $$cfiledirs; \
91
cd $$cfiledirs; for cfiles in `echo $(srcdir)/$$cfiledirs/*.c`; \
92
do $(LN_S) $$cfiles 2>/dev/null; done; cd ..; done
94
# make links in srcdir
95
-@for cfiles in `echo $(srcdir)/*.c`; do $(LN_S) $$cfiles 2>/dev/null; done
98
for DEPS in `echo *.c */*.c`; do \
99
$(CC) -I. -I $(srcdir) -M -I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\"" $(CPPFLAGS) $$DEPS | \
100
$(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done
107
$(INSTALL_PROGRAM) gpm $(sbindir)/gpm
108
$(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a
109
$(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h
110
# POSIX requires the range of a for loop be nonempty and Bash
111
# 2.x goes along; unfortunately that means an additional
112
# headache in cases like this
113
if test "xlibgpm.so" != "x" ; then \
114
$(INSTALL_DATA) -m 644 lib/libgpm.so.2.0.0 $(libdir)/libgpm.so.2.0.0 ; \
115
cd $(libdir) && $(LN_S) -f libgpm.so.2.0.0 libgpm.so.2 ; \
116
echo "WARNING: We installed a lib, you should now call ldconfig" ; \
117
echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.2.0.0" ; \
118
echo "Or to update everything just type ldconfig" ; \
120
# The unversioned files seems to be not needed -> correct me, if I am wrong.
121
# && $(LN_S) -f libgpm.so.2 libgpm.so ; \
124
for i in $(PROG); do \
125
$(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\
129
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install
131
# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn
132
# This is probably the right thing, because programs may be linked to it
134
rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \
135
$(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h
136
for i in $(PROG); do \
137
rm -f $(bindir)/$$i ;\
140
# Configure & unconfigure
142
Makefile: Makefile.in
143
$(top_builddir)/config.status Makefile
146
prog/gpm-root.c: $(srcdir)/prog/gpm-root.y
147
$(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c
149
# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir)
150
prog/gpm-root: prog/gpm-root.c lib/libgpm.so.2
151
$(CC) -I. -I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\"" $(CPPFLAGS) -Wall -g -D_REENTRANT -O2 $(CFLAGS) -c -o $@.o $<
152
$(CC) -L$(srcdir) $(LDFLAGS) -o $@ $@.o $(LIBS) lib/libgpm.so.2
154
prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o prog/open_console.o
155
$(CC) -L$(srcdir) $(LDFLAGS) -o $@ $^ $(LIBS) -lm
157
$(PROG): lib/libgpm.so.2
160
lib/libgpm.a: $(LOBJ)
161
$(AR) rc lib/libgpm.a $(LOBJ)
162
$(RANLIB) lib/libgpm.a
164
lib/libgpm.so.2.0.0: $(PICS)
165
$(CC) -fPIC -shared -Wl,-soname,libgpm.so.2 \
166
-L$(srcdir) $(LDFLAGS) -o lib/libgpm.so.2.0.0 $^ $(LIBS)
167
lib/libgpm.so.2: lib/libgpm.so.2.0.0
168
$(LN_S) -f libgpm.so.2.0.0 lib/libgpm.so.2
169
# unneeded, isn't it?
170
#lib/libgpm.so: lib/libgpm.so.2.0.0
171
# $(LN_S) -f libgpm.so.2.0.0 lib/libgpm.so
180
rm -f gpm lib/libgpm.a lib/libgpm.so.* $(RDEPS)
181
rm -f core *~ $(GOBJ) $(LOBJ) $(POBJ) $(PICS) gpm-root.c $(DEPFILE)
182
rm -f $(PROG) $(POBJ) prog/gpm-root.c prog/open_console.o
185
rm -f headers/config.h headers/drivers.h \
189
rm -f headers/config.h.in