Subversion Repositories avr32-toolchain

Rev

Rev 9 | Rev 11 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9 Rev 10
Line 66... Line 66...
66
SUPP_PREFIX = $(CURDIR)/supp
66
SUPP_PREFIX = $(CURDIR)/supp
67
PATH       := ${PREFIX}/bin:${SUPP_PREFIX}/bin:${PATH}
67
PATH       := ${PREFIX}/bin:${SUPP_PREFIX}/bin:${PATH}
68
AUTOCONF    = $(SUPP_PREFIX)/bin/autoconf
68
AUTOCONF    = $(SUPP_PREFIX)/bin/autoconf
69
AUTOMAKE    = $(SUPP_PREFIX)/bin/automake
69
AUTOMAKE    = $(SUPP_PREFIX)/bin/automake
70
70
-
 
71
STAMP_DIR  := $(CURDIR)/stamps
-
 
72
DOWNLOAD_DIR := $(CURDIR)/downloads
-
 
73
71
ifeq ($(strip $(BUG_URL)),)
74
ifeq ($(strip $(BUG_URL)),)
72
BUG_URL = https://github.com/jsnyder/avr32-toolchain
75
BUG_URL = https://github.com/jsnyder/avr32-toolchain
73
endif
76
endif
74
PKG_VERSION = "AVR 32 bit GNU Toolchain-$(AVR_PATCH_REV)-$(TOOL_REV)"
77
PKG_VERSION = "AVR 32 bit GNU Toolchain-$(AVR_PATCH_REV)-$(TOOL_REV)"
75
78
Line 140... Line 143...
140
tst:
143
tst:
141
	@echo "PREFIX=$(PREFIX)"
144
	@echo "PREFIX=$(PREFIX)"
142
	@echo "PKG_VERSION=$(PKG_VERSION)"
145
	@echo "PKG_VERSION=$(PKG_VERSION)"
143
	@echo "BUG_URL=$(BUG_URL)"
146
	@echo "BUG_URL=$(BUG_URL)"
144
147
-
 
148
-
 
149
############ MACROS for the lazy people ;-) ############
-
 
150
-
 
151
ifeq ($(strip $(MAKEFLAGS)),s)
-
 
152
define quiet_text
-
 
153
	@echo "$1"
-
 
154
endef
-
 
155
else
-
 
156
define quiet_text
-
 
157
endef
-
 
158
endif
-
 
159
-
 
160
## remove a stamp
-
 
161
define rm_stamp
-
 
162
	rm -f $(STAMP_DIR)/$(1)
-
 
163
endef
-
 
164
-
 
165
## create the stamp directory if not existing and the stamp
-
 
166
define make_stamp
-
 
167
	@[ -d $(STAMP_DIR) ] || mkdir $(STAMP_DIR)
-
 
168
	date > $(STAMP_DIR)/$(1)
-
 
169
endef
-
 
170
-
 
171
## create the download rule and force download rule
-
 
172
define DOWNLOAD_template
-
 
173
download-$(1): $(DOWNLOAD_DIR)/$$($(1)_ARCHIVE)
-
 
174
download-$(1)-f $(DOWNLOAD_DIR)/$$($(1)_ARCHIVE): $(DOWNLOAD_DIR)
-
 
175
	cd $(DOWNLOAD_DIR) && curl -LO $$($(1)_URL)
-
 
176
PHONY += download-$(1) download-$(1)-f
-
 
177
endef
-
 
178
-
 
179
## extract commands
-
 
180
EXT_BZ2 := tar -jxf
-
 
181
EXT_TGZ := tar -xf
-
 
182
EXT_ZIP := unzip -o
-
 
183
-
 
184
## create the extract rule and force extract rule
-
 
185
define EXTRACT_template
-
 
186
extract-$(1): $(STAMP_DIR)/extract-$(1)
-
 
187
extract-$(1)-f $(STAMP_DIR)/extract-$(1): $(DOWNLOAD_DIR)/$$($(1)_ARCHIVE)
-
 
188
	@(rm -rf autoconf-*; \
-
 
189
	t1=`openssl md5 $$< | cut -f 2 -d " " -` && \
-
 
190
	[ "$$$$t1" = "$$($(1)_MD5)" ] || \
-
 
191
	( echo "Bad Checksum! Please remove the following file and retry: $$<" && false ))
-
 
192
	$(call quiet_text,"Extracting $$($(1)_ARCHIVE)")
-
 
193
	$($(2)) $$<
-
 
194
	$(call make_stamp,extract-$(1))
-
 
195
PHONY += extract-$(1) extract-$(1)-f
-
 
196
endef
-
 
197
-
 
198
$(DOWNLOAD_DIR):
-
 
199
	mkdir $(DOWNLOAD_DIR)
-
 
200
-
 
201
$(eval $(call DOWNLOAD_template,AUTOCONF))
-
 
202
$(eval $(call EXTRACT_template,AUTOCONF,EXT_BZ2))
-
 
203
-
 
204
.PHONY: $(PHONY)
-
 
205
-
 
206
-
 
207
.PHONY: tst2 tst3
-
 
208
tst2:
-
 
209
	$(call make_stamp,JES)
-
 
210
tst3:
-
 
211
	$(call rm_stamp,JES)
-
 
212
-
 
213
145
.PHONY: install-note
214
.PHONY: install-note
146
install-note: install-tools
215
install-note: install-tools
147
	@echo
216
	@echo
148
	@echo ====== INSTALLATION NOTE ======
217
	@echo ====== INSTALLATION NOTE ======
149
	@echo Your tools have now been installed at the following prefix:
218
	@echo Your tools have now been installed at the following prefix:
Line 168... Line 237...
168
	rm stamps/install-supp-tools;
237
	rm stamps/install-supp-tools;
169
238
170
239
171
############# SUPP: AUTOCONF ############
240
############# SUPP: AUTOCONF ############
172
241
173
.PHONY: download-autoconf download-autoconf-force
242
##.PHONY: download-autoconf download-autoconf-force
174
download-autoconf: downloads/$(AUTOCONF_ARCHIVE)
243
##download-autoconf: downloads/$(AUTOCONF_ARCHIVE)
175
download-autoconf-force downloads/$(AUTOCONF_ARCHIVE):
244
##download-autoconf-force downloads/$(AUTOCONF_ARCHIVE):
176
	[ -d downloads ] || mkdir downloads ;
245
##	[ -d downloads ] || mkdir downloads ;
177
	cd downloads && curl -LO $(AUTOCONF_URL)
246
##	cd downloads && curl -LO $(AUTOCONF_URL)
178
247
179
.PHONY: extract-autoconf extract-autoconf-force
248
##.PHONY: extract-autoconf extract-autoconf-force
180
extract-autoconf: stamps/extract-autoconf
249
##extract-autoconf: stamps/extract-autoconf
181
extract-autoconf-force stamps/extract-autoconf: downloads/$(AUTOCONF_ARCHIVE)
250
##extract-autoconf-force stamps/extract-autoconf: downloads/$(AUTOCONF_ARCHIVE)
182
	@(t1=`openssl md5 $< | cut -f 2 -d " " -` && \
251
##	@(t1=`openssl md5 $< | cut -f 2 -d " " -` && \
183
	[ "$$t1" = "$(AUTOCONF_MD5)" ] || \
252
##	[ "$$t1" = "$(AUTOCONF_MD5)" ] || \
184
	( echo "Bad Checksum! Please remove the following file and retry: $<" && false ))
253
##	( echo "Bad Checksum! Please remove the following file and retry: $<" && false ))
185
	tar -jxf $< ;
254
##	tar -jxf $< ;
186
	[ -d stamps ] || mkdir stamps ;
255
##	[ -d stamps ] || mkdir stamps ;
187
	touch stamps/extract-autoconf;
256
##	touch stamps/extract-autoconf;
188
257
189
.PHONY: build-autoconf build-autoconf-force
258
.PHONY: build-autoconf build-autoconf-force
190
build-autoconf: stamps/build-autoconf
259
build-autoconf: stamps/build-autoconf
191
build-autoconf-force stamps/build-autoconf: stamps/extract-autoconf
260
build-autoconf-force stamps/build-autoconf: stamps/extract-autoconf
192
	mkdir -p build/autoconf && cd build/autoconf && \
261
	mkdir -p build/autoconf && cd build/autoconf && \