diff options
Diffstat (limited to 'mfi-mqtt/Makefile')
-rw-r--r-- | mfi-mqtt/Makefile | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mfi-mqtt/Makefile b/mfi-mqtt/Makefile index a30dfbd..96b1016 100644 --- a/mfi-mqtt/Makefile +++ b/mfi-mqtt/Makefile | |||
@@ -1,12 +1,18 @@ | |||
1 | BUILDROOT := $(HOME)/tmp/buildroot-2019.02.7 | 1 | BUILDROOT := $(HOME)/tmp/buildroot-2019.02.7 |
2 | MIPS_GCC := $(BUILDROOT)/output/host/bin/mips-buildroot-linux-uclibc-gcc | 2 | MIPS_GCC := $(BUILDROOT)/output/host/bin/mips-buildroot-linux-uclibc-gcc |
3 | MIPS_STRIP := $(BUILDROOT)/output/host/mips-buildroot-linux-uclibc/bin/strip | ||
4 | VERSION := $(shell git describe --tags --dirty --long) | ||
5 | |||
6 | mfi-mqtt-mips-stripped: mfi-mqtt-mips | ||
7 | cp $< $@ | ||
8 | $(MIPS_STRIP) $@ | ||
3 | 9 | ||
4 | mfi-mqtt-mips: reporting.o mosquitto.o mfi-mqtt.o | 10 | mfi-mqtt-mips: reporting.o mosquitto.o mfi-mqtt.o |
5 | $(MIPS_GCC) -o $@ $^ -lpthread -lmosquitto -ljson-c -static | 11 | $(MIPS_GCC) -o $@ $^ -lpthread -lmosquitto -ljson-c -static |
6 | 12 | ||
7 | %.o: %.c | 13 | %.o: %.c |
8 | $(MIPS_GCC) -Wall -c -o $@ $< | 14 | $(MIPS_GCC) -DVERSION=$(VERSION) -Wall -c -o $@ $< |
9 | 15 | ||
10 | .PHONY: clean | 16 | .PHONY: clean |
11 | clean: | 17 | clean: |
12 | rm -f *.o mfi-mqtt-mips | 18 | rm -f *.o mfi-mqtt-mips mfi-mqtt-mips-stripped |