X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=power%2Fdaemon%2FMakefile;h=caa0e16c5645730fd536bb7985c7028211a60224;hb=a9d52ef421c6de4507ec8d294665e55fc83bfe49;hp=b779cc91466edfb09bb7a5816483dec0f8e4f0c2;hpb=8399132ed0569e3c92d3dae4fa37b519409775c3;p=home-hw.git diff --git a/power/daemon/Makefile b/power/daemon/Makefile index b779cc9..caa0e16 100644 --- a/power/daemon/Makefile +++ b/power/daemon/Makefile @@ -1,23 +1,22 @@ -TOPDIR=/root/turris - -include $(TOPDIR)/rules.mk -include $(TOPDIR)/include/package.mk - -PC := PATH=$(STAGING_DIR_HOST)/bin:$(PATH) PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) PKG_CONFIG_LIBDIR=$(PKG_CONFIG_PATH) STAGING_PREFIX=$(STAGING_DIR)/usr $(PKG_CONFIG) -MB_CFLAGS := $(shell $(PC) --cflags libmodbus) -MB_LDFLAGS := $(shell $(PC) --libs libmodbus) +PC=pkg-config UCW_CFLAGS := $(shell $(PC) --cflags libucw) -UCW_LDFLAGS := $(shell $(PC) --libs libucw) +UCW_LIBS := $(shell $(PC) --libs libucw) +MODBUS_CFLAGS := $(shell $(PC) --cflags libmodbus) +MODBUS_LIBS := $(shell $(PC) --libs libmodbus) +MOSQUITTO_CFLAGS := $(shell $(PC) --cflags libmosquitto) +MOSQUITTO_LIBS := $(shell $(PC) --libs libmosquitto) -export PATH=$(TARGET_PATH_PKG) -CC=$(TARGET_CC_NOCACHE) -LD=$(TARGET_LD_NOCACHE) -CFLAGS=$(TARGET_CFLAGS) $(MB_CFLAGS) $(UCW_CFLAGS) -std=gnu99 -LDFLAGS=$(TARGET_LDFLAGS) $(MB_LDFLAGS) $(UCW_LDFLAGS) -lmosquitto +CFLAGS=-O2 -Wall -Wextra -Wno-sign-compare -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes $(UCW_CFLAGS) $(MODBUS_CFLAGS) $(MOSQUITTO_CFLAGS) +LDLIBS=$(UCW_LIBS) $(MODBUS_LIBS) $(MOSQUITTO_LIBS) -all: burrow-powerd upload +all: burrow-powerd burrow-powerd: burrow-powerd.c -upload: - rsync -av burrow-powerd micac:/root/burrow/ +install: burrow-powerd + install burrow-powerd /usr/local/sbin/ + +clean: + rm -f *.o burrow-powerd + +.PHONY: all clean install