summaryrefslogtreecommitdiff
path: root/mfi-mqtt/Makefile
blob: 96b10163b9d80a2a85ebe158e76af00110e05086 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
BUILDROOT := $(HOME)/tmp/buildroot-2019.02.7
MIPS_GCC := $(BUILDROOT)/output/host/bin/mips-buildroot-linux-uclibc-gcc
MIPS_STRIP := $(BUILDROOT)/output/host/mips-buildroot-linux-uclibc/bin/strip
VERSION := $(shell git describe --tags --dirty --long)

mfi-mqtt-mips-stripped: mfi-mqtt-mips
	cp $< $@
	$(MIPS_STRIP) $@

mfi-mqtt-mips: reporting.o mosquitto.o mfi-mqtt.o
	$(MIPS_GCC) -o $@ $^ -lpthread -lmosquitto -ljson-c -static

%.o: %.c
	$(MIPS_GCC) -DVERSION=$(VERSION) -Wall -c -o $@ $<

.PHONY: clean
clean:
	rm -f *.o mfi-mqtt-mips mfi-mqtt-mips-stripped