aboutsummaryrefslogtreecommitdiff
path: root/testing/build.test1/Makefile
blob: 7271bf2c6dc17ba12f3d70f82617e535453b5d80 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# -*- mode: makefile -*-
#
default: _complain_
include ./local.uses

%: _complain_


_complain_:
	@echo ""
	@echo " Try the target: cygwin.buildtest or linux.buildtest "
	@echo ""

remove.install:
	rm -rf ${INSTALL_DIR}

.PHONY: remove.install

cygwin.buildtest:
	${MAKE} -f Makefile.ftd2xx clean all
	${MAKE} -f Makefile.openocd cygwin.easy.permutations
	${MAKE} -f Makefile.openocd mingw32.easy.permutations
	${MAKE} -f Makefile.libftdi all
	${MAKE} -f Makefile.openocd cygwin.libftdi

linux.buildtest: 
	${MAKE} linux.easy.buildtest
	${MAKE} linux.ftd2xx_installed 
	${MAKE} linux.ft2232_libftdi
	@echo ""
	@echo ""
	@echo "========================================"
	@echo " Linux Build Tests Complete "
	@echo "========================================"
	@echo ""
	@echo ""


linux.easy.buildtest:
	@test -d openocd || (echo "Where the source to openocd?" && exit 1)
	${MAKE} -f Makefile.openocd bootstrap
	${MAKE} -f Makefile.ftd2xx  all
	${MAKE} -f Makefile.openocd linux.easy.permutations

linux.ftd2xx_installed: 
	${MAKE} remove.install
	${MAKE} linux.ftd2xx_installed.setup
	${MAKE} -f Makefile.openocd $@

 linux.ft2232_libftdi:
	${MAKE} remove.install 
	${MAKE} -f Makefile.libusb  all
	${MAKE} -f Makefile.confuse all
	${MAKE} -f Makefile.libftdi all
	${MAKE} -f Makefile.openocd $@

# This target is used to "install" files from
# the FTDICHIP.COM tar.gz unpack directory
# into "a proper place" - where they should be found.
linux.ftd2xx_installed.setup:
	mkdir -p ${INSTALL_DIR}/include
	mkdir -p ${EXEC_PREFIX}/lib
	@#
	@# Sanity check - make sure the .H file is findable
	@#
	@f=$(FTD2XX_LINUX_DIR)/ftd2xx.h && \
	test -f $$f || (echo "Error: $$f not found" ; exit 1)
	@#
	@# Header files are simple... just copy them.
	@#
	cp $(FTD2XX_LINUX_DIR)/ftd2xx.h   $(PREFIX)/include/.
	cp $(FTD2XX_LINUX_DIR)/WinTypes.h $(PREFIX)/include/.
	@#
	@# .SO files are harder.
	@#     (1) copy them, (2) make links
	@#
	cp $(FTD2XX_LINUX_DIR)/libftd2xx.so.$(FTD2XX_LINUX_VERSION) $(EXEC_PREFIX)/lib/.
	cd $(EXEC_PREFIX)/lib && rm -f libftd2xx.so.0
	cd $(EXEC_PREFIX)/lib && ln -s libftd2xx.so.$(FTD2XX_LINUX_VERSION) libftd2xx.so.0
	cd $(EXEC_PREFIX)/lib && rm -f libftd2xx.so
	cd $(EXEC_PREFIX)/lib && ln -s libftd2xx.so.$(FTD2XX_LINUX_VERSION) libftd2xx.so


all.download:
	mkdir -p ${VIRGINS}
	${MAKE} -f Makefile.confuse download
	${MAKE} -f Makefile.libftdi download
	${MAKE} -f Makefile.ftd2xx  download
	${MAKE} -f Makefile.libusb  download

.PHONY: linux.buildtest \
	linux.easy.buildtest \
	linux.ftd2xx_installed \
	linux.ft22232_libftdi \
	linux.ftd2xx_installed.setup