aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 018f97c74e5827882023e92737d53c49172fa91b (plain) (blame)
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
.POSIX:

OBJ = xkbdbind.o
HDR = config.h

CONFIGFILE = config.mk
include $(CONFIGFILE)

all: xkbdbind
$(OBJ): $(HDR)

xkbdbind: $(OBJ) $(HDR)
	$(CC) -o $@ $(OBJ) $(LDFLAGS)

.c.o:
	$(CC) -c -o $@ $< $(CFLAGS)

install: xkbdbind
	mkdir -p -- "$(DESTDIR)$(PREFIX)/bin"
	mkdir -p -- "$(DESTDIR)$(PREFIX)/src/$(PACKAGE)"
	mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1"
	cp -- xkbdbind "$(DESTDIR)$(PREFIX)/bin/"
	cp -- $(OBJ:.o=.c) $(HDR) Makefile "$(DESTDIR)$(PREFIX)/src/$(PACKAGE)/"
	test ! -e -- "$(DESTDIR)$(PREFIX)/src/$(PACKAGE)/config.mk"
	cp -- $(CONFIGFILE) "$(DESTDIR)$(PREFIX)/src/$(PACKAGE)/config.mk"
	cp -- xkbdbind.1 "$(DESTDIR)$(MANPREFIX)/man1/"

uninstall:
	-rm -f -- "$(DESTDIR)$(PREFIX)/bin/xkbdbind"
	-rm -rf -- "$(DESTDIR)$(PREFIX)/src/$(PACKAGE)"
	-rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/xkbdbind.1"

clean:
	-rm -f -- xkbdbind *.o

.SUFFIXES:
.SUFFIXES: .c .o

.PHONY: all install uninstall clean