summaryrefslogtreecommitdiff
blob: 982885056ac67f7467daa908bc63f7300fefcd9b (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
DESTDIR=
PREFIX=$(DESTDIR)/opt/ati-stream-sdk/
LIBDIR=$(PREFIX)lib/
BINDIR=$(PREFIX)bin/
INCDIR=$(PREFIX)include/
ETCDIR=$(DESTDIR)etc/

INSTALLBIN=install
INSTALLDAT=install -m0644
INSTALLDIR=install -d
MKDIR=mkdir -p

ARCH:=x86
BINFILES=bin/x86$(DSUFX)/clc 
LIBFILES=lib/x86$(DSUFX)/libOpenCL.so lib/x86$(DSUFX)/libatiocl$(SUFX).so lib/x86$(DSUFX)/libGLEW.so lib/gpu/builtins-7xx.bc lib/gpu/builtins-evergreen.bc lib/gpu/builtins-gpucommon.bc lib/x86$(DSUFX)/builtins-x86$(DSUFX).bc
INCFILES=include/cal*.h include/CL/* include/GL/* include/OVDecode/*
ETCFILES=etc/OpenCL/vendors/atiocl$(SUFX).icd

ifeq ($(ARCH),amd64)
DSUFX=_64
SUFX=64
else
DSUFX=
SUFX=32
endif

install-etc:
	test -z "$(ETCDIR)" || $(MKDIR) "$(ETCDIR)"
	tar -xzf icd-registration.tgz || exit 1
	@list='$(ETCFILES)'; for f in $$list; do\
		if test -f $$f; then\
			f1=`echo $$f | sed -e 's|etc/||g'`;\
			base=`basename $$f1`;\
			dir=`echo $$f1 | sed -e "s|$$base||g"`;\
			test -z "$(ETCDIR)$$dir" || $(MKDIR) "$(ETCDIR)$$dir";\
			echo "$(INSTALLDAT) $$f $(ETCDIR)$$f1";\
			$(INSTALLDAT) "$$f" $(ETCDIR)$$f1 || exit 1;\
		else :; fi;\
	done

install-bin:
	test -z "$(BINDIR)" || $(MKDIR) "$(BINDIR)"
	@list='$(BINFILES)'; for f in $$list; do\
		if test -f $$f; then\
			f1=`basename $$f`;\
			echo "$(INSTALLBIN) $$f $(BINDIR)$$f1";\
			$(INSTALLBIN) "$$f" "$(BINDIR)$$f1" || exit 1;\
		else :; fi;\
	done

install-lib:
	test -z "$(LIBDIR)" || $(MKDIR) "$(LIBDIR)"
	@list='$(LIBFILES)'; for f in $$list; do\
		if test -f $$f; then\
			f1=`echo $$f | sed -e 's|lib/||g' -e 's|x86*/||g'`;\
			base=`basename $$f1`;\
			dir=`echo $$f1 | sed -e "s|$$base||g"`;\
			test -z "$(LIBDIR)$$dir" || $(MKDIR) "$(LIBDIR)$$dir";\
			echo "$(INSTALLBIN) $$f $(LIBDIR)$$f1";\
			$(INSTALLBIN) "$$f" "$(LIBDIR)$$f1" || exit 1;\
		else :; fi;\
	done

install-include:
	test -z "$(INCDIR)" || $(MKDIR) "$(INCDIR)"
	@list='$(INCFILES)'; for f in $$list; do\
		if test -f $$f; then\
			f1=`echo $$f | sed -e 's|include||g'`;\
			base=`basename $$f1`;\
			dir=`echo $$f1 | sed -e "s|$$base||g"`;\
			test -z "$(INCDIR)$$dir" || $(MKDIR) "$(INCDIR)$$dir";\
			echo "$(INSTALLDAT) $$f $(INCDIR)$$f1";\
			$(INSTALLDAT) $$f $(INCDIR)$$f1 || exit 1;\
		else :; fi;\
	done

install: install-etc install-bin install-lib install-include