cortex_a: fix endiannes issues on TI TMS570
[openocd.git] / testing / build.test1 / Makefile.openocd
blob6b0cb56ff0f8188a3a99f93a78f050c541ad4830
1 # -*- mode: makefile -*-
3 default: _complain_
5 include ./local.uses
8 SRC_DIR      ?= $(HERE)/openocd
9 BUILD_SUFFIX ?= $(BUILD_MACHINE)
10 BUILD_DIR =$(HERE)/openocd.$(BUILD_SUFFIX)
12 checkout:
13         svn co https://svn.berlios.de/svnroot/repos/openocd/trunk openocd
15 remove.install:
16         rm -rf ${INSTALL_DIR}
18 #========================================
19 # Win32 Build Permutations
20 #   none
21 #   parport
22 #   ftd2xx - (ftdichip)
23 #   libftd
24 CONFIG_OPTIONS_win32_none     = 
25 CONFIG_OPTIONS_win32_parport  = --enable-parport
26 CONFIG_OPTIONS_win32_ftd2xx   = --enable-parport --enable-ft2232_ftd2xx --with-ftd2xx-win32-zipdir=$(FTD2XX_WIN32_DIR)
28 CYGWIN_EASY_PERMUTATIONS += none
29 CYGWIN_EASY_PERMUTATIONS += parport
30 CYGWIN_EASY_PERMUTATIONS += ftd2xx
32 MINGW32_EASY_PERMUTATIONS += none
33 MINGW32_EASY_PERMUTATIONS += parport
34 MINGW32_EASY_PERMUTATIONS += ftd2xx
37 # This is not a possible permutation, it is manual :-(
38 # Why? Because "libftdi" installs things into install/include
39 # which would efect the 'ftd2xx' win32 build
40 CONFIG_OPTIONS_win32_libftdi  = --enable-parport --enable-ft2232_libftdi
42 # Default build for win32... is the ftd2xx type build.
43 PERMUTE_win32          ?= ftd2xx
44 CONFIG_OPTIONS_win32   ?= $(CONFIG_OPTIONS_win32_$(PERMUTE_win32))
45 CONFIG_OPTIONS_cygwin   = $(CONFIG_OPTIONS_win32)
46 CONFIG_OPTIONS_mingw32  = $(CONFIG_OPTIONS_win32)
48 #========================================
49 # Linux Build Permuatations
50 #    none
51 #    parport
52 #    ft2232_ftd2xx
53 #    ft2232_libftdi 
54 CONFIG_OPTIONS_linux_none    =
55 LINUX_EASY_PERMUTATIONS     += none
57 CONFIG_OPTIONS_linux_parport = --enable-parport
58 LINUX_EASY_PERMUTATIONS     += parport
60 CONFIG_OPTIONS_linux_ft2232_libftdi = --enable-parport --enable-ft2232-libftdi
61 #this cannot be done as part of the permutations.
62 #LINUX_EASY_PERMUTATIONS += ft2232_libftdi
64 CONFIG_OPTIONS_linux_ft2232_ftd2xx_static  = \
65         --enable-parport \
66         --enable-ft2232-ftd2xx --with-ftd2xx-lib=static --with-ftd2xx-linux-tardir=$(FTD2XX_LINUX_DIR)
67 LINUX_EASY_PERMUTATIONS += ft2232_ftd2xx_static
69 # this is not a possible permutation it is manual :-(
70 # why? because it interfers with the other permutations
71 # by "installing files" in the $(INSTALL_DIR)
72 CONFIG_OPTIONS_linux_ftd2xx_installed  = \
73         --enable-parport \
74         --enable-ft2232-ftd2xx \
75         --with-ftd2xx-lib=shared
77 # The default build permutation is
78 PERMUTE_linux ?= ft2232_ftd2xx_static
79 CONFIG_OPTIONS_linux = $(CONFIG_OPTIONS_linux_$(PERMUTE_linux))
81 CONFIG_OPTIONS_darwin=\
82         --enable-ftd2232-libftdi
84 # Which build are we doing?
85 CONFIG_OPTIONS := $(CONFIG_OPTIONS_$(BUILD_SYSNAME))
87 bootstrap:
88         cd $(SRC_DIR) && bash ./bootstrap
90 clean::
91         rm -rf $(BUILD_DIR)
93 ifndef CFLAGS
94 _CFLAGS=true
95 else
96 _CFLAGS=export CFLAGS="${CFLAGS}"
97 endif
100 # if this was given... then pass it on 
101 configure:
102         @echo "     Build Sysname: $(BUILD_SYSNAME)"
103         @echo "    Config Options: $(CONFIG_OPTIONS)"
104         rm -rf $(BUILD_DIR)
105         mkdir $(BUILD_DIR)
106         ${_CFLAGS} && \
107         cd $(BUILD_DIR) && \
108                 $(SRC_DIR)/configure \
109                         --prefix=$(PREFIX) \
110                         --exec-prefix=$(EXEC_PREFIX) \
111                         $(CONFIG_OPTIONS)
113 build:
114         cd $(BUILD_DIR) && $(MAKE)
116 install:
117         cd $(BUILD_DIR) && $(MAKE) install
119 all: configure build install
121 .PHONY: install
123 # The "cygwin.libftdi" requires that libftdi be built
124 # and installed *PRIOR* to running this target.
125 # it is not part of the permutations because ... 
126 # it interfers with the ftd2xx based builds
127 cygwin.libftdi: 
128         $(MAKE) -f Makefile.openocd bootstrap
129         $(MAKE) BUILD_SUFFIX=$@ PERMUTE_win32=libftdi -f Makefile.openocd all
131 cygwin.easy.permutations: remove.install ${CYGWIN_EASY_PERMUTATIONS:%=_cygwin.%}
133 _cygwin.%:
134         @echo ""
135         @echo ""
136         @echo "========================================"
137         @echo "Permutation Build... $@"
138         @echo "========================================"
139         @echo ""
140         @echo ""
141         $(MAKE) PERMUTE_win32=$* BUILD_SUFFIX=cygwin.$* -f Makefile.openocd all 
142         $(EXEC_PREFIX)/bin/openocd -v   
144 mingw32.easy.permutations: remove.install ${MINGW32_EASY_PERMUTATIONS:%=_mingw32.%}
146 # I (duane) build openocd-mingw32 via Cygwin.
147 # Sadly, the "mingw32" buid for cygwin does not include
148 # the required "elf.h" header files... so ... 
149 # we have them in our own private helper place.
150 _mingw32.%:
151         @echo ""
152         @echo ""
153         @echo "========================================"
154         @echo "Permutation Build... $@"
155         @echo "========================================"
156         @echo ""
157         @echo ""
158         CFLAGS="-mno-cygwin -I$(HERE)/mingw32_help/include" \
159         $(MAKE) -f Makefile.openocd all ;\
160         $(EXEC_PREFIX)/bin/openocd -v   
162 win32.permutations: mingw32.permutations cygwin.permutations
165 # SMOKE TEST - Build every linux permuation...
166 # If "openocd -v" does exit(0) we are good enough.
168 linux.easy.permutations: remove.install ${LINUX_EASY_PERMUTATIONS:%=_linux.%}
171 _linux.%:
172         @echo ""
173         @echo ""
174         @echo "========================================"
175         @echo "Permutation Build... $@"
176         @echo "========================================"
177         @echo ""
178         @echo ""
179         $(MAKE) PERMUTE_linux=$* BUILD_SUFFIX=linux.$* -f Makefile.openocd all 
180         $(EXEC_PREFIX)/bin/openocd -v   
182 linux.ftd2xx_installed:
183         ${MAKE} -f Makefile.openocd _$@
185 linux.ft2232_libftdi:
186         ${MAKE} -f Makefile.openocd _$@
188 _complain_:
189         @echo ""
190         @echo "Please try one of these targets: bootstrap, clean, configure, build, install"
191         @echo " Or read the makefile and learn about the permutation test targets"
192         @echo ""
193         @exit 1