~ubuntu-branches/ubuntu/wily/gpm/wily

« back to all changes in this revision

Viewing changes to src/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Peter Eisentraut
  • Date: 2009-04-24 18:41:08 UTC
  • mfrom: (3.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090424184108-5asldbyqe6g6gorq
Tags: 1.20.4-3.2
* Non-maintainer upload.
* debian/patches/070_struct_ucred: fix FTBFS. Closes: #520853

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#                       -*-makefile-*- (gpm/src)
 
2
#
 
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>
 
7
#
 
8
 
 
9
srcdir = /home/peter/devel/debian/status-support/gpm-1.20.4/src
 
10
top_builddir = ..
 
11
 
 
12
include $(top_builddir)/Makefile.include
 
13
 
 
14
# Main portion: regular build rules
 
15
 
 
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
 
29
 
 
30
GOBJ = $(GSRC:.c=.o) report.o tools.o
 
31
 
 
32
LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c
 
33
 
 
34
LOBJ = $(LSRC:.c=.o) tools.o lib/libcurses.o
 
35
 
 
36
PICS = $(LOBJ:.o=.lo)
 
37
 
 
38
HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h
 
39
 
 
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
 
42
 
 
43
POBJ = $(PSRC:.c=.o) prog/gpm-root.o
 
44
 
 
45
PROG = $(POBJ:.o=)
 
46
 
 
47
SRCS = $(GSRC) $(LSRC) $(PSRC) report.c
 
48
 
 
49
DEFS  = -DHAVE_CONFIG_H
 
50
 
 
51
STRIP = -s
 
52
 
 
53
### BUILD PROCESS
 
54
 
 
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.
 
59
 
 
60
# the prog rules are not very clean...
 
61
prog/%.o: prog/%.c
 
62
        $(CC) -Iheaders -I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\"" $(CPPFLAGS) -Wall -g -D_REENTRANT -O2 $(CFLAGS) -c -o $@ $<
 
63
 
 
64
prog/%: prog/%.o
 
65
        $(CC) -L$(srcdir) $(LDFLAGS) -o $@ $^  $(LIBS)
 
66
 
 
67
%.o: %.c
 
68
        $(CC) -I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\"" $(CPPFLAGS) -Wall -g -D_REENTRANT -O2 $(CFLAGS) -c -o $@ $<
 
69
 
 
70
%.lo:   %.c
 
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 $@ $<
 
72
 
 
73
%:      %.o
 
74
        $(CC) -L$(srcdir) $(LDFLAGS) -o $@ $^  $(LIBS)
 
75
 
 
76
# old, unused, but good rule [dependings]
 
77
#%.d: $(srcdir)/%.c
 
78
#       $(SHELL) -ec '$(CC) -M $(GPMCPPFLAGS) $(CPPFLAGS) $< \
 
79
#               | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@'
 
80
 
 
81
# Do it all!
 
82
all:    gpm lib/libgpm.so.2 lib/libgpm.a $(PROG)
 
83
 
 
84
gpm:    $(GOBJ)
 
85
        $(CC) -L$(srcdir) $(LDFLAGS) -o $@ $(GOBJ)  $(LIBS) -lm
 
86
 
 
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
 
93
 
 
94
        # make links in srcdir
 
95
        -@for cfiles in `echo $(srcdir)/*.c`; do $(LN_S) $$cfiles 2>/dev/null; done
 
96
 
 
97
        # create dependencies
 
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
 
101
 
 
102
### INSTALL
 
103
check:  all
 
104
installdirs:
 
105
 
 
106
install:        check 
 
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"                                                                                 ;       \
 
119
        fi
 
120
#                       The unversioned files seems to be not needed -> correct me, if I am wrong.
 
121
#                       && $(LN_S) -f libgpm.so.2  libgpm.so                                                                                    ;       \
 
122
 
 
123
   # prog/
 
124
        for i in $(PROG); do \
 
125
                $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\
 
126
        done
 
127
 
 
128
install-strip:
 
129
        $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install
 
130
 
 
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
 
133
uninstall:
 
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 ;\
 
138
        done
 
139
 
 
140
# Configure & unconfigure
 
141
 
 
142
Makefile: Makefile.in
 
143
        $(top_builddir)/config.status Makefile
 
144
 
 
145
# Subdirectory prog/
 
146
prog/gpm-root.c:        $(srcdir)/prog/gpm-root.y
 
147
        $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c
 
148
 
 
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
 
153
 
 
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
 
156
 
 
157
$(PROG):        lib/libgpm.so.2
 
158
 
 
159
# Subdirectory lib/
 
160
lib/libgpm.a:   $(LOBJ)
 
161
        $(AR) rc lib/libgpm.a $(LOBJ)
 
162
        $(RANLIB) lib/libgpm.a
 
163
 
 
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
 
172
 
 
173
include $(DEPFILE)
 
174
 
 
175
## Release / Dist
 
176
 
 
177
 
 
178
## Cleanup
 
179
clean:
 
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
 
183
 
 
184
distclean: clean
 
185
        rm -f headers/config.h headers/drivers.h \
 
186
                Makefile $(DEPFILE)
 
187
 
 
188
allclean: clean
 
189
        rm -f headers/config.h.in