Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
5af57d58
Commit
5af57d58
authored
Jan 11, 2016
by
Johny Mattsson
Browse files
Guard against short downloads.
Also bail out if trying to use the replacement libmain.a with a non-1.5.0 SDK.
parent
cf2aa574
Changes
1
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
5af57d58
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
SDK_VER
:=
1.5.0
SDK_VER
:=
1.5.0
SDK_FILE_VER
:=
1.5.0_15_11_27
SDK_FILE_VER
:=
1.5.0_15_11_27
SDK_FILE_ID
:=
989
SDK_FILE_ID
:=
989
SDK_FILE_SIZE
:=
2184553
# Ensure we search "our" SDK before the tool-chain's SDK (if any)
# Ensure we search "our" SDK before the tool-chain's SDK (if any)
TOP_DIR
:=
$(
abspath
$(
dir
$(
lastword
$(MAKEFILE_LIST)
)))
TOP_DIR
:=
$(
abspath
$(
dir
$(
lastword
$(MAKEFILE_LIST)
)))
SDK_DIR
:=
$(TOP_DIR)
/sdk/esp_iot_sdk_v
$(SDK_VER)
SDK_DIR
:=
$(TOP_DIR)
/sdk/esp_iot_sdk_v
$(SDK_VER)
...
@@ -180,8 +181,13 @@ $(TOP_DIR)/sdk/.binpatched: $(TOP_DIR)/cache/libmain_ESP8266_NONOS_SDK_V1.5.0.zi
...
@@ -180,8 +181,13 @@ $(TOP_DIR)/sdk/.binpatched: $(TOP_DIR)/cache/libmain_ESP8266_NONOS_SDK_V1.5.0.zi
touch
$@
touch
$@
$(TOP_DIR)/cache/libmain_ESP8266_NONOS_SDK_V1.5.0.zip
:
$(TOP_DIR)/cache/libmain_ESP8266_NONOS_SDK_V1.5.0.zip
:
ifeq
($(SDK_VER),1.5.0)
mkdir
-p
"
$(
dir
$@
)
"
mkdir
-p
"
$(
dir
$@
)
"
wget
--tries
=
10
--timeout
=
15
--waitretry
=
30
--read-timeout
=
20
--retry-connrefused
--continue
https://github.com/jmattsson/nodemcu-firmware/releases/download/tmr-libmain-binpatch150/
$(
notdir
$@
)
-O
$@
wget
--tries
=
10
--timeout
=
15
--waitretry
=
30
--read-timeout
=
20
--retry-connrefused
https://github.com/jmattsson/nodemcu-firmware/releases/download/tmr-libmain-binpatch150/
$(
notdir
$@
)
-O
$@
||
{
rm
-f
"
$@
"
;
exit
1
;
}
[
`
ls
-l
"
$@
"
|
awk
'{print $$5}'
`
-eq
58400
]
||
{
rm
-f
"
$@
"
;
exit
1
;
}
else
@
echo
"ERROR: Attempting to use replacement libmain.a for SDK 1.5.0 with SDK
$(SDK_VER)
- don't do that!"
;
false
endif
$(TOP_DIR)/sdk/.extracted
:
$(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_FILE_VER).zip
$(TOP_DIR)/sdk/.extracted
:
$(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_FILE_VER).zip
mkdir
-p
"
$(
dir
$@
)
"
mkdir
-p
"
$(
dir
$@
)
"
...
@@ -191,7 +197,8 @@ $(TOP_DIR)/sdk/.extracted: $(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_FILE_VER).zip
...
@@ -191,7 +197,8 @@ $(TOP_DIR)/sdk/.extracted: $(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_FILE_VER).zip
$(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_FILE_VER).zip
:
$(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_FILE_VER).zip
:
mkdir
-p
"
$(
dir
$@
)
"
mkdir
-p
"
$(
dir
$@
)
"
wget
--tries
=
10
--timeout
=
15
--waitretry
=
30
--read-timeout
=
20
--retry-connrefused
--continue
http://bbs.espressif.com/download/file.php?id
=
$(SDK_FILE_ID)
-O
$@
wget
--tries
=
10
--timeout
=
15
--waitretry
=
30
--read-timeout
=
20
--retry-connrefused
http://bbs.espressif.com/download/file.php?id
=
$(SDK_FILE_ID)
-O
$@
||
{
rm
-f
"
$@
"
;
exit
1
;
}
[
`
ls
-l
"
$@
"
|
awk
'{print $5}'
`
-eq
$(SDK_FILE_SIZE)
]
||
{
rm
-f
"
$@
"
;
exit
1
;
}
clean
:
clean
:
$(
foreach
d,
$(SUBDIRS)
,
$(MAKE)
-C
$(d)
clean
;
)
$(
foreach
d,
$(SUBDIRS)
,
$(MAKE)
-C
$(d)
clean
;
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment