APPS = hello_maiwe TARGET = armv7-unknown-linux-gnueabi TARGET_PATH = target/$(TARGET)/release CROSS_COMPILER_PREFIX = /opt/gcc-cross-compile/arm-broadcom-linux-uclibcgnueabi/usr/bin/arm-broadcom-linux-uclibcgnueabi .PHONY: all install clean distclean all: build_toml cargo +nightly build -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target $(TARGET) --release install: cp $(TARGET_PATH)/$(APPS) . ; \ $(CROSS_COMPILER_PREFIX)-strip $(APPS) ; \ upx --best --lzma $(APPS) clean: rm -f $(TARGET_PATH)/$(APPS) $(APPS) distclean: clean cargo clean ; \ if [ -d .cargo ] ; then \ rm -rf .cargo/ ; \ fi build_toml: if [ ! -d .cargo ] ; then \ mkdir .cargo ; \ touch .cargo/config.toml ; \ echo '[target.$(TARGET)]' >> .cargo/config.toml ; \ echo 'linker = "$(CROSS_COMPILER_PREFIX)-gcc"' >> .cargo/config.toml ; \ fi