source: trunk/xdotool/Makefile @ 1081

Last change on this file since 1081 was 1081, checked in by dkg, 5 years ago

xdotool: removed "install" target which uses hard-coded paths; preferring debhelper instructions.

File size: 1.8 KB
Line 
1WARNFLAGS+=-pedantic -Wall -W -Wno-missing-field-initializers -Wundef \
2           -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast \
3           -Wcast-align -Wwrite-strings -Wstrict-prototypes \
4           -Wmissing-prototypes -Wnested-externs -Winline \
5           -Wdisabled-optimization
6
7CFLAGS=-pipe -std=c99 $(WARNFLAGS)
8
9DEFAULT_LIBS=-L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXtst
10DEFAULT_INC=-I/usr/X11R6/include -I/usr/local/include
11
12LIBS=`pkg-config --libs x11 xtst 2> /dev/null || echo "$(DEFAULT_LIBS)"`
13INC=`pkg-config --cflags x11 xtst 2> /dev/null || echo "$(DEFAULT_INC)"`
14
15CFLAGS+=$(INC)
16LDFLAGS+=$(LIBS)
17
18all: xdotool xdotool.1
19
20installprog: xdotool
21        install -m 755 xdotool $(INSTALLBIN)/
22
23installman: xdotool.1
24        [ -d $(INSTALLMAN) ] || mkdir $(INSTALLMAN)
25        [ -d $(INSTALLMAN)/man1 ] || mkdir $(INSTALLMAN)/man1
26        install -m 644 xdotool.1 $(INSTALLMAN)/man1/
27
28deinstall: uninstall
29uninstall:
30        rm -f $(INSTALLBIN)/xdotool
31        rm -f $(INSTALLMAN)/man1/xdotool.1
32
33
34clean:
35        rm -f *.o xdotool || true
36
37xdo.o: xdo.c
38        gcc $(CFLAGS) -c xdo.c
39
40xdotool.o: xdotool.c
41        gcc $(CFLAGS) -c xdotool.c
42
43xdo.c: xdo.h
44xdotool.c: xdo.h
45
46xdotool: xdotool.o xdo.o
47        gcc $(CFLAGS) $(LDFLAGS) xdotool.o xdo.o -o $@
48
49xdotool.1: xdotool.pod
50        pod2man -c "" -r "" xdotool.pod > $@
51
52package: test-package-build create-package
53
54create-package: xdotool.1
55        @NAME=xdotool-`date +%Y%m%d`; \
56        echo "Creating package: $$NAME"; \
57        mkdir $${NAME}; \
58        rsync --exclude .svn -a `ls -d *.1 *.pod COPYRIGHT *.c *.h examples t CHANGELIST README Makefile* 2> /dev/null` $${NAME}/; \
59        tar -zcf $${NAME}.tar.gz $${NAME}/; \
60        rm -rf $${NAME}/
61
62# Make sure the package we're building compiles.
63test-package-build: create-package
64        @NAME=xdotool-`date +%Y%m%d`; \
65        echo "Testing package $$NAME"; \
66        tar -zxf $${NAME}.tar.gz; \
67        make -C $${NAME} xdotool; \
68        rm -rf $${NAME}/
69        rm -f $${NAME}.tar.gz
70
Note: See TracBrowser for help on using the repository browser.