File: Makefile.am

package info (click to toggle)
numlockx 1.2-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 472 kB
  • sloc: sh: 905; ansic: 677; makefile: 120
file content (128 lines) | stat: -rw-r--r-- 3,753 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# $Id: Makefile.am,v 1.8 2001/04/30 19:34:10 seli Exp $

bin_PROGRAMS = numlockx

numlockx_SOURCES = main.c 
numlockx_LDADD   = @XTESTLIB@ -lXext -lX11 @X_PRE_LIBS@
numlockx_LDFLAGS = @X_LDFLAGS@
INCLUDES = @X_INCLUDES@

CFLAGS = @CFLAGS@ -Wall -pedantic

EXTRA_DIST = AUTHORS LICENSE ChangeLog INSTALL README TODO 

AUTOMAKE_OPTIONS = foreign

xsetup:
	@if test -n "@xsetup@"; then \
	    echo "Modifying @xsetup@"; \
	    rm -f @xsetup@.tmp ;\
	    cat @xsetup@ | grep -v "numlockx" > @xsetup@.tmp ;\
	    echo "# Turn NumLock on ( numlockx ) ---------------" >> @xsetup@.tmp ;\
	    echo "${bindir}/numlockx " >> @xsetup@.tmp ;\
	    echo "# numlockx -----------------------------------" >> @xsetup@.tmp ;\
	    cp -f @xsetup@ ${srcdir}/xsetup.sav ;\
	    cat @xsetup@.tmp > @xsetup@ ;\
	    rm -f @xsetup@.tmp; \
	else \
	    echo "Xsetup not found! - nothing to update";\
	fi

xsetup_uninstall:
	@if test -n "@xsetup@"; then \
	    echo "Restoring @xsetup@"; \
	    rm -f @xsetup@.tmp ;\
	    cat @xsetup@ | grep -v "numlockx" > @xsetup@.tmp ;\
	    cat @xsetup@.tmp > @xsetup@ ;\
	    rm -f @xsetup@.tmp; \
	else \
	    echo "Xsetup not found! - nothing to restore";\
	fi

xinitrc:
	@if test -n "@xinitrc@"; then \
	    echo "Modifying @xinitrc@"; \
	    rm -f @xinitrc@.tmp ;\
	    cat @xinitrc@ | grep -v "numlockx" \
		| ( was_mod= ; \
		    ifs_sav=$IFS ;\
		    IFS= ;\
		    while read ln; do \
			if test -n "$$ln"; then \
			    if test "$${ln#\#}" = "$$ln" ; then \
				if test -z "$$was_mod"; then \
			    	    was_mod=1 ;\
			    	    echo "# Turn NumLock on ( numlockx ) ---------------";\
			    	    echo "${bindir}/numlockx ";\
				    echo "# numlockx -----------------------------------" ;\
				fi \
			    fi \
			fi; \
			echo "$$ln" ;\
		    done; \
		    IFS=$$ifs_sav ;\
		    if test -z "$$was_mod"; then \
		        was_mod=1 ;\
		        echo "# Turn NumLock on ( numlockx ) ---------------";\
		        echo "${bindir}/numlockx ";\
			echo "# numlockx -----------------------------------" ;\
		    fi \
		  ) \
		> @xinitrc@.tmp ;\
	    cp -f @xinitrc@ ${srcdir}/xinitrc.sav ;\
	    cat @xinitrc@.tmp > @xinitrc@ ;\
	    rm -f @xinitrc@.tmp ;\
	else \
	    echo "xinitrc not found! - nothing to update";\
	fi

xinitrc_uninstall:
	@if test -n "@xinitrc@"; then \
	    echo "Restoring @xinitrc@"; \
	    rm -f @xinitrc@.tmp ;\
	    cat @xinitrc@ | grep -v "numlockx" > @xinitrc@.tmp ;\
	    cat @xinitrc@.tmp > @xinitrc@ ;\
	    rm -f @xinitrc@.tmp ;\
	else \
	    echo "xinitrc not found! - nothing to restore";\
	fi

user_xinitrc:
	@if test -f ~/.xinitrc; then \
	    echo "Modifying ~/.xinitrc"; \
	    rm -f xinitrc.tmp ;\
	    cat ~/.xinitrc | grep -v "numlockx" \
		| ( was_mod= ; \
		ifs_sav=$IFS ;\
		IFS= ;\
		while read ln; do \
		    if test -n "$$ln"; then \
			if test "$${ln#\#}" = "$$ln" ; then \
			    if test -z "$$was_mod"; then \
		    		was_mod=1 ;\
		    		echo "# Turn NumLock on ( numlockx ) ---------------";\
		    		echo "${bindir}/numlockx ";\
				echo "# numlockx -----------------------------------" ;\
			    fi \
			fi \
		    fi; \
		    echo "$$ln" ;\
		done; \
		IFS=$$ifs_sav ;\
		if test -z "$$was_mod"; then \
	    	    was_mod=1 ;\
	    	    echo "# Turn NumLock on ( numlockx ) ---------------";\
	    	    echo "${bindir}/numlockx ";\
		    echo "# numlockx -----------------------------------" ;\
		fi \
	          ) \
		> xinitrc.tmp ;\
		cp -f ~/.xinitrc ${srcdir}/xinitrc.sav ;\
		cat xinitrc.tmp > ~/.xinitrc ;\
		rm -f xinitrc.tmp ;\
	else \
	    echo "# Turn NumLock on ( numlockx ) ---------------" >> ~/.xinitrc; \
	    echo "${bindir}/numlockx " >> ~/.xinitrc;\
	    echo "# numlockx -----------------------------------" >> ~/.xinitrc;\
	    chmod 700 ~/.xinitrc ; \
	fi