Skip to content

Commit

Permalink
Travis & appveyor fixes
Browse files Browse the repository at this point in the history
* Add error checks to appveyor `build.cmd`
* Remove additional Host build for Travis, instead add it into SDK 3.0.0
* Build mqttc as a module, not as a library, so intermediate object files aren't created in source tree
* Build all `C` files to gnu99` standard. Previously defaulted to `gnu90`. Note that `std99` breaks the build.
* Ignore errors in `user-lib-clean` as Host lib doesn't exist in repo (no default libraries)
  • Loading branch information
mikee47 committed May 19, 2019
1 parent 25a5b39 commit 513be2c
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 44 deletions.
24 changes: 15 additions & 9 deletions .appveyor/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,32 @@ make help
make list-config

REM Compile the tools first
make tools V=1
make tools V=1 || goto :error

IF "%SDK_VERSION%" == "2.0.0" (
REM Build Host Emulator and run basic tests
set SMING_ARCH=Host
cd %SMING_HOME%
make STRICT=1
make Basic_Serial
make Basic_ProgMem
make STRICT=1 || goto :error
make Basic_Serial || goto :error
make Basic_ProgMem || goto :error
cd %SMING_HOME%\..\samples\HostTests
make flash
make flash || goto :error
)

REM Build library and test sample apps
set SMING_ARCH=Esp8266
cd %SMING_HOME%
make STRICT=1
make STRICT=1 || goto :error
cd %SMING_HOME%\..\samples\Basic_Blink
make V=1
make V=1 || goto :error
cd %SMING_HOME%\..\samples\Basic_Ssl
make
make || goto :error
cd %SMING_HOME%\..\samples\Basic_SmartConfig
make
make || goto :error

goto :EOF

:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ matrix:
env: SDK_VERSION=1.5.0
- os: linux
env: SDK_VERSION=2.0.0
- os: linux
env: SDK_VERSION=3.0.0
- os: linux
dist: xenial
env: SDK_VERSION=Host
env: SDK_VERSION=3.0.0
git:
submodules: false
addons:
Expand Down
31 changes: 17 additions & 14 deletions .travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ fi

cd $SMING_HOME

if [ "$SDK_VERSION" = "Host" ]; then
export PATH=$PATH:$ESP_HOME/xtensa-lx106-elf/bin:$ESP_HOME/utils/:$SMING_HOME/../.travis/tools
if [ "$SDK_VERSION" = "2.0.0" ]; then
../.travis/tools/clang/format-pr.sh;
fi

if [ "$SDK_VERSION" = "3.0.0" ]; then
export SMING_ARCH=Host
export STRICT=1
make help
Expand All @@ -22,17 +27,15 @@ if [ "$SDK_VERSION" = "Host" ]; then
make Basic_Blink Basic_DateTime Basic_Delegates Basic_Interrupts Basic_ProgMem Basic_Serial Basic_Servo LiveDebug DEBUG_VERBOSE_LEVEL=3
cd ../samples/HostTests
make flash
else
export PATH=$PATH:$ESP_HOME/xtensa-lx106-elf/bin:$ESP_HOME/utils/:$SMING_HOME/../.travis/tools
if [ "$SDK_VERSION" = "2.0.0" ]; then
../.travis/tools/clang/format-pr.sh;
fi
make help
make list-config
make STRICT=1
make samples
make clean samples-clean
make ENABLE_CUSTOM_HEAP=1 STRICT=1
make Basic_Blink ENABLE_CUSTOM_HEAP=1 DEBUG_VERBOSE_LEVEL=3
make dist-clean; make HttpServer_ConfigNetwork ENABLE_CUSTOM_LWIP=2 STRICT=1
cd $SMING_HOME
fi

export SMING_ARCH=Esp8266
make help
make list-config
make STRICT=1
make samples
make clean samples-clean
make ENABLE_CUSTOM_HEAP=1 STRICT=1
make Basic_Blink ENABLE_CUSTOM_HEAP=1 DEBUG_VERBOSE_LEVEL=3
make dist-clean; make HttpServer_ConfigNetwork ENABLE_CUSTOM_LWIP=2 STRICT=1
2 changes: 1 addition & 1 deletion Sming/Arch/Esp8266/app.mk
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ LIBS += $(LIBPWM)


#
LIBS := microc microgcc hal phy pp net80211 mqttc wpa $(LIBSMING) crypto smartconfig $(EXTRA_LIBS) $(LIBS)
LIBS := microc microgcc hal phy pp net80211 wpa $(LIBSMING) crypto smartconfig $(EXTRA_LIBS) $(LIBS)

# linker flags used to generate the main object file
LDFLAGS = -nostdlib -u call_user_start -u Cache_Read_Enable_New -u custom_crash_callback \
Expand Down
16 changes: 2 additions & 14 deletions Sming/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,8 @@ MODULES += $(COMPONENTS)/ws_parser

# => mqtt-codec
SUBMODULES += $(COMPONENTS)/mqtt-codec
MODULES += $(COMPONENTS)/mqtt-codec/src
EXTRA_INCDIR += $(COMPONENTS)/mqtt-codec/src
LIBMQTTC := mqttc
LIBS += $(LIBMQTTC)
BUILD_MQTTC := $(MAKE) -C $(COMPONENTS)/mqtt-codec MQTT_ENABLE_SERVER=0 MQTT_ENABLE_CLIENT=1 CC=$(CC) AR=$(AR) \
CFLAGS_EXTRA="-ISystem/include $(CFLAGS_COMMON)" \
LIB_FOLDER="$(SMING_HOME)/$(USER_LIBDIR)"
CLEAN += mqttc-clean

$(call UserLibPath,$(LIBMQTTC)):
$(Q) $(BUILD_MQTTC) lib

.PHONY: mqttc-clean
mqttc-clean:
-$(Q) $(BUILD_MQTTC) clean


# => yuarel
Expand Down Expand Up @@ -170,7 +158,7 @@ clean: $(CLEAN) ##Remove all generated build files
.PHONY: user-lib-clean
user-lib-clean: ##Remove generated user libraries
-$(Q) rm -f $(wildcard $(USER_LIBDIR)/lib*.a) $(APP_AR)
$(Q) $(GIT) checkout $(USER_LIBDIR)
-$(Q) $(GIT) checkout $(USER_LIBDIR)

##@Building

Expand Down
4 changes: 2 additions & 2 deletions Sming/modules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ $2/%.o: $1/%.S
$(AS) $(INCDIR) $(CFLAGS) -c $$< -o $$@
$2/%.o: $1/%.c $2/%.c.d
$(vecho) "CC $$<"
$(CC) $(INCDIR) $(CFLAGS) -c $$< -o $$@
$(CC) $(INCDIR) $(CFLAGS) -std=gnu99 -c $$< -o $$@
$2/%.o: $1/%.cpp $2/%.cpp.d
$(vecho) "C+ $$<"
$(CXX) $(INCDIR) $(CXXFLAGS) -c $$< -o $$@
$2/%.c.d: $1/%.c
$(CC) $(INCDIR) $(CFLAGS) -MM -MT $2/$$*.o $$< -o $$@
$(CC) $(INCDIR) $(CFLAGS) -std=gnu99 -MM -MT $2/$$*.o $$< -o $$@
$2/%.cpp.d: $1/%.cpp
$(CXX) $(INCDIR) $(CXXFLAGS) -MM -MT $2/$$*.o $$< -o $$@

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ install:
- cmd: mingw-get upgrade

build_script:
- cmd /C %APPVEYOR_BUILD_FOLDER%\.appveyor\build.cmd
- cmd: .appveyor/build.cmd

0 comments on commit 513be2c

Please sign in to comment.