summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 41c39cf1404ca0b7b01945fa82cc64df92241b68 (plain)
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
include Makefile.config

DESTDIR=
libdir=/usr/lib
bindir=/usr/bin
sbindir=/usr/sbin
libexecdir=/usr/libexec
desktopdir=/usr/share/applications
autostartdir=/usr/share/autostart
xinitdir=/etc/X11/xinit.d
iconsdir=/usr/lib/libDrakX/icons
pixmapsdir=/usr/share/libDrakX/pixmaps

BIN_TOOLS= 
SBIN_TOOLS= drakx-update-background display_driver_helper
INLIBDEST_DIRS = lib/xf86misc

all: $(INLIBDEST_DIRS)
	install -d auto
	(find lib -name '*.pm'; find tools -type f) | xargs perl -pi -e 's/\s*use\s+(diagnostics|vars|strict).*//g'
	for i in po $(INLIBDEST_DIRS); do 	make -C $$i; done
	make -C po
	make -C polkit

check:
	@for p in `find lib -name *.pm`; do perl -cw -I$(libdir)/libDrakX $$p || exit 1; done
	@for p in tools/*; do head -n1 $$p | grep perl || continue; perl -cw $$p || exit 1; done

install:
	install -d $(DESTDIR){$(libdir),$(bindir),$(sbindir),$(desktopdir),$(autostartdir),$(xinitdir),$(iconsdir),$(pixmapsdir),$(libexecdir)}

	install -d $(INLIBDEST_DIRS:%=$(DESTDIR)$(libdir)/libDrakX//%)
	cp -a lib/*.pm $(DESTDIR)$(libdir)/libDrakX/
	find auto -follow -name .exists -o -name "*.bs" | xargs rm -f
	cp -rfL auto $(DESTDIR)$(libdir)/libDrakX

	(cd lib; for i in */; do install -d $(DESTDIR)$(libdir)/libDrakX/$$i ; install -m 644 $$i/*.pm $(DESTDIR)$(libdir)/libDrakX/$$i/;done)
	(cd tools; \
	  [[ -n "$(BIN_TOOLS)" ]] && install -m755 $(BIN_TOOLS) $(DESTDIR)$(bindir); \
	  [[ -n "$(SBIN_TOOLS)" ]] && install -m755 $(SBIN_TOOLS) $(DESTDIR)$(sbindir); \
	)
	install -m755 tools/keyboarddrake $(DESTDIR)$(libexecdir)/drakkeyboard
	install -m755 tools/mousedrake $(DESTDIR)$(libexecdir)/drakmouse
	install -m755 tools/XFdrake $(DESTDIR)$(libexecdir)/drakx11
	# Some compatibility name wrappers
	ln -s drakkeyboard $(DESTDIR)$(bindir)/keyboarddrake
	ln -s drakmouse $(DESTDIR)$(bindir)/mousedrake
	ln -s drakx11 $(DESTDIR)$(bindir)/XFdrake
	ln -s drakx11 $(DESTDIR)$(bindir)/Xdrakres
	#install -m644 $(wildcard data/*.desktop) $(DESTDIR)$(desktopdir)
	#install -m644 $(wildcard data/icons/*.png) $(DESTDIR)$(iconsdir)
	install -m644 $(wildcard data/pixmaps/*.png) $(DESTDIR)$(pixmapsdir)
	make -C po install
	make -C polkit install

clean:
	make -C po clean
	make -C polkit clean

dist:
	rm -rf ../$(NAME)-$(VERSION).tar*
	@git archive --prefix=$(NAME)-$(VERSION)/ HEAD | xz >../$(NAME)-$(VERSION).tar.xz;
	$(info $(NAME)-$(VERSION).tar.xz is ready)