From 2fc56f05d144e60b98639382f61d00dc61c2c667 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 11 Aug 2018 22:01:19 +0200 Subject: [PATCH] Cleanup --- ssr/host/Makefile | 29 +++++++++++++++++++++++------ ssr/{turris => host}/burrow-ssrd.c | 0 ssr/{turris => host}/ssr-control.c | 0 ssr/test/Makefile | 9 +++++++++ ssr/{host => test}/test.c | 0 ssr/turris/Makefile | 26 -------------------------- 6 files changed, 32 insertions(+), 32 deletions(-) rename ssr/{turris => host}/burrow-ssrd.c (100%) rename ssr/{turris => host}/ssr-control.c (100%) create mode 100644 ssr/test/Makefile rename ssr/{host => test}/test.c (100%) delete mode 100644 ssr/turris/Makefile diff --git a/ssr/host/Makefile b/ssr/host/Makefile index a31dce1..57d9081 100644 --- a/ssr/host/Makefile +++ b/ssr/host/Makefile @@ -1,9 +1,26 @@ -UCWCF:=$(shell PKG_CONFIG_PATH=$(LIBUCW)/lib/pkgconfig pkg-config --cflags libucw) -UCWLF:=$(shell PKG_CONFIG_PATH=$(LIBUCW)/lib/pkgconfig pkg-config --libs libucw) +TOPDIR=/root/turris -CFLAGS=-std=gnu99 -O2 -Wall -Wextra -Wno-parentheses $(UCWCF) -LDLIBS=-lusb-1.0 $(UCWLF) +include $(TOPDIR)/rules.mk +include $(TOPDIR)/include/package.mk -all: test +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) +USB_CFLAGS := $(shell $(PC) --cflags libusb-1.0) +USB_LDFLAGS := $(shell $(PC) --libs libusb-1.0) +UCW_CFLAGS := $(shell $(PC) --cflags libucw) +UCW_LDFLAGS := $(shell $(PC) --libs libucw) -test: test.c +export PATH=$(TARGET_PATH_PKG) +CC=$(TARGET_CC_NOCACHE) +LD=$(TARGET_LD_NOCACHE) +CFLAGS=$(TARGET_CFLAGS) $(USB_CFLAGS) $(UCW_CFLAGS) -std=gnu99 +LDFLAGS=$(TARGET_LDFLAGS) $(USB_LDFLAGS) $(UCW_LDFLAGS) -lmosquitto + +all: ssr-control burrow-ssrd upload + +ssr-control: ssr-control.c +burrow-ssrd: burrow-ssrd.c + +upload: + rsync -av ssr-control burrow-ssrd micac:burrow/ + +.PHONY: upload diff --git a/ssr/turris/burrow-ssrd.c b/ssr/host/burrow-ssrd.c similarity index 100% rename from ssr/turris/burrow-ssrd.c rename to ssr/host/burrow-ssrd.c diff --git a/ssr/turris/ssr-control.c b/ssr/host/ssr-control.c similarity index 100% rename from ssr/turris/ssr-control.c rename to ssr/host/ssr-control.c diff --git a/ssr/test/Makefile b/ssr/test/Makefile new file mode 100644 index 0000000..a31dce1 --- /dev/null +++ b/ssr/test/Makefile @@ -0,0 +1,9 @@ +UCWCF:=$(shell PKG_CONFIG_PATH=$(LIBUCW)/lib/pkgconfig pkg-config --cflags libucw) +UCWLF:=$(shell PKG_CONFIG_PATH=$(LIBUCW)/lib/pkgconfig pkg-config --libs libucw) + +CFLAGS=-std=gnu99 -O2 -Wall -Wextra -Wno-parentheses $(UCWCF) +LDLIBS=-lusb-1.0 $(UCWLF) + +all: test + +test: test.c diff --git a/ssr/host/test.c b/ssr/test/test.c similarity index 100% rename from ssr/host/test.c rename to ssr/test/test.c diff --git a/ssr/turris/Makefile b/ssr/turris/Makefile deleted file mode 100644 index 57d9081..0000000 --- a/ssr/turris/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -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) -USB_CFLAGS := $(shell $(PC) --cflags libusb-1.0) -USB_LDFLAGS := $(shell $(PC) --libs libusb-1.0) -UCW_CFLAGS := $(shell $(PC) --cflags libucw) -UCW_LDFLAGS := $(shell $(PC) --libs libucw) - -export PATH=$(TARGET_PATH_PKG) -CC=$(TARGET_CC_NOCACHE) -LD=$(TARGET_LD_NOCACHE) -CFLAGS=$(TARGET_CFLAGS) $(USB_CFLAGS) $(UCW_CFLAGS) -std=gnu99 -LDFLAGS=$(TARGET_LDFLAGS) $(USB_LDFLAGS) $(UCW_LDFLAGS) -lmosquitto - -all: ssr-control burrow-ssrd upload - -ssr-control: ssr-control.c -burrow-ssrd: burrow-ssrd.c - -upload: - rsync -av ssr-control burrow-ssrd micac:burrow/ - -.PHONY: upload -- 2.39.2