|
@@ -9,7 +9,7 @@ GO := go
|
|
|
GO_BUILD := $(GO) build
|
|
GO_BUILD := $(GO) build
|
|
|
GO_FLAGS := -ldflags "-s -w -X hnyfkj.com.cn/rtu/linux/baseapp.Version=1.0.0.1 -X hnyfkj.com.cn/rtu/linux/baseapp.BuildTime=$(shell date +%Y-%m-%dT%H:%M:%S)"
|
|
GO_FLAGS := -ldflags "-s -w -X hnyfkj.com.cn/rtu/linux/baseapp.Version=1.0.0.1 -X hnyfkj.com.cn/rtu/linux/baseapp.BuildTime=$(shell date +%Y-%m-%dT%H:%M:%S)"
|
|
|
|
|
|
|
|
-target ?= x86_64
|
|
|
|
|
|
|
+target ?= armv7hf
|
|
|
ifeq ($(target),armv7hf)
|
|
ifeq ($(target),armv7hf)
|
|
|
GOOS := linux
|
|
GOOS := linux
|
|
|
GOARCH := arm
|
|
GOARCH := arm
|
|
@@ -29,7 +29,7 @@ SETGO_ENV = \
|
|
|
DATE := $(shell date +%Y%m%d_%H%M%S)
|
|
DATE := $(shell date +%Y%m%d_%H%M%S)
|
|
|
|
|
|
|
|
# 编译的目标
|
|
# 编译的目标
|
|
|
-all : hk_takephoto.out air720u_4g.out rtu_linux_modules.out
|
|
|
|
|
|
|
+all : camera_test.out hk_takephoto.out dh_takephoto.out air720u_4g.out rtu_linux_modules.out
|
|
|
|
|
|
|
|
# 通用基础库
|
|
# 通用基础库
|
|
|
libswapi.a :
|
|
libswapi.a :
|
|
@@ -39,6 +39,10 @@ libswapi.a :
|
|
|
libhk_takephoto.a :
|
|
libhk_takephoto.a :
|
|
|
$(MAKE) -C hk_takephoto target=$(target) $@
|
|
$(MAKE) -C hk_takephoto target=$(target) $@
|
|
|
|
|
|
|
|
|
|
+# "iRAYPLE"
|
|
|
|
|
+libdh_takephoto.a :
|
|
|
|
|
+ $(MAKE) -C dh_takephoto target=$(target) $@
|
|
|
|
|
+
|
|
|
# "Air720U"
|
|
# "Air720U"
|
|
|
libair720u.a :
|
|
libair720u.a :
|
|
|
$(MAKE) -C air720u target=$(target) $@
|
|
$(MAKE) -C air720u target=$(target) $@
|
|
@@ -47,11 +51,11 @@ libair720u.a :
|
|
|
libair530z.a :
|
|
libair530z.a :
|
|
|
$(MAKE) -C air530z target=$(target) $@
|
|
$(MAKE) -C air530z target=$(target) $@
|
|
|
|
|
|
|
|
-# "EC200U"
|
|
|
|
|
|
|
+## "EC200U"
|
|
|
libec200u.a :
|
|
libec200u.a :
|
|
|
$(MAKE) -C ec200u target=$(target) $@
|
|
$(MAKE) -C ec200u target=$(target) $@
|
|
|
|
|
|
|
|
-# "YMODEM"
|
|
|
|
|
|
|
+## "YMODEM"
|
|
|
libymodem.a :
|
|
libymodem.a :
|
|
|
$(MAKE) -C ymodem target=$(target) $@
|
|
$(MAKE) -C ymodem target=$(target) $@
|
|
|
|
|
|
|
@@ -63,10 +67,10 @@ else
|
|
|
LIB1 += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_takephoto/lib/x86_64/64 -lMvCameraControl
|
|
LIB1 += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_takephoto/lib/x86_64/64 -lMvCameraControl
|
|
|
endif
|
|
endif
|
|
|
hk_takephoto.out : libswapi.a libhk_takephoto.a ./tests/hk_takephoto/main.go
|
|
hk_takephoto.out : libswapi.a libhk_takephoto.a ./tests/hk_takephoto/main.go
|
|
|
- mkdir -p ./build/takephoto_test
|
|
|
|
|
|
|
+ mkdir -p ./build/hk_takephoto_test
|
|
|
$(GO) mod tidy
|
|
$(GO) mod tidy
|
|
|
$(SETGO_ENV) CGO_LDFLAGS="$(LIB1)" $(GO_BUILD) $(GO_FLAGS) -o $@ ./tests/hk_takephoto/main.go
|
|
$(SETGO_ENV) CGO_LDFLAGS="$(LIB1)" $(GO_BUILD) $(GO_FLAGS) -o $@ ./tests/hk_takephoto/main.go
|
|
|
- @cp $@ ./build/takephoto_test/$(basename $@)_$(DATE)$(suffix $@)
|
|
|
|
|
|
|
+ @cp $@ ./build/hk_takephoto_test/$(basename $@)_$(DATE)$(suffix $@)
|
|
|
rm -rf $@
|
|
rm -rf $@
|
|
|
|
|
|
|
|
# 测4G模块Air720U
|
|
# 测4G模块Air720U
|
|
@@ -87,10 +91,43 @@ ec200u_4g.out : libswapi.a libec200u.a ./tests/ec200u/main.go
|
|
|
@cp $@ ./build/ec200u_test/$(basename $@)_$(DATE)$(suffix $@)
|
|
@cp $@ ./build/ec200u_test/$(basename $@)_$(DATE)$(suffix $@)
|
|
|
rm -rf $@
|
|
rm -rf $@
|
|
|
|
|
|
|
|
-# 主测试程序
|
|
|
|
|
-LIBS := -Wl,-Bstatic -L./swapi -lswapi -L./hk_takephoto -lhk_takephoto -L./air720u -lair720u -L./air530z -lair530z -L./ec200u -lec200u
|
|
|
|
|
|
|
+# 大华相机拍照测试
|
|
|
|
|
+LIB4 := -Wl,-Bstatic -L./swapi -lswapi -L./dh_takephoto -ldh_takephoto
|
|
|
|
|
+ifeq ($(target),armv7hf)
|
|
|
|
|
+ LIB4 += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/dh_takephoto/lib/armv7hf -lMVSDK -liImageProcessing -lImageConvert -llog4cpp -lMvLSCProcess
|
|
|
|
|
+ LIB4 += -L$(PWD)/dh_takephoto/lib/armv7hf/GenICam/bin -lGCBase_gcc483_v3_0 -lGenApi_gcc483_v3_0 -lLog_gcc483_v3_0 -llog4cpp_gcc483_v3_0 -lMathParser_gcc483_v3_0 -lNodeMapData_gcc483_v3_0 -lXmlParser_gcc483_v3_0
|
|
|
|
|
+else
|
|
|
|
|
+ $(error Unsupported target: $(target), only armv7hf is supported)
|
|
|
|
|
+endif
|
|
|
|
|
+dh_takephoto.out : libswapi.a libdh_takephoto.a ./tests/dh_takephoto/main.go
|
|
|
|
|
+ mkdir -p ./build/dh_takephoto_test
|
|
|
|
|
+ $(GO) mod tidy
|
|
|
|
|
+ $(SETGO_ENV) CGO_LDFLAGS="$(LIB4)" $(GO_BUILD) $(GO_FLAGS) -o $@ ./tests/dh_takephoto/main.go
|
|
|
|
|
+ @cp $@ ./build/dh_takephoto_test/$(basename $@)_$(DATE)$(suffix $@)
|
|
|
|
|
+ rm -rf $@
|
|
|
|
|
+
|
|
|
|
|
+# 综合相机测试程序
|
|
|
|
|
+LIB5 := -Wl,-Bstatic -L./swapi -lswapi -L./hk_takephoto -lhk_takephoto -L./dh_takephoto -ldh_takephoto
|
|
|
|
|
+ifeq ($(target),armv7hf)
|
|
|
|
|
+ LIB5 += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_takephoto/lib/armv7hf/. -lMvCameraControl
|
|
|
|
|
+ LIB5 += -L$(PWD)/dh_takephoto/lib/armv7hf -lMVSDK -liImageProcessing -lImageConvert -llog4cpp -lMvLSCProcess
|
|
|
|
|
+ LIB5 += -L$(PWD)/dh_takephoto/lib/armv7hf/GenICam/bin -lGCBase_gcc483_v3_0 -lGenApi_gcc483_v3_0 -lLog_gcc483_v3_0 -llog4cpp_gcc483_v3_0 -lMathParser_gcc483_v3_0 -lNodeMapData_gcc483_v3_0 -lXmlParser_gcc483_v3_0
|
|
|
|
|
+else
|
|
|
|
|
+ $(error Unsupported target: $(target), only armv7hf is supported)
|
|
|
|
|
+endif
|
|
|
|
|
+camera_test.out : libswapi.a libhk_takephoto.a libdh_takephoto.a ./tests/camera/main.go
|
|
|
|
|
+ mkdir -p ./build/camera_test
|
|
|
|
|
+ $(GO) mod tidy
|
|
|
|
|
+ $(SETGO_ENV) CGO_LDFLAGS="$(LIB5)" $(GO_BUILD) $(GO_FLAGS) -o $@ ./tests/camera/main.go
|
|
|
|
|
+ @cp $@ ./build/camera_test/$(basename $@)_$(DATE)$(suffix $@)
|
|
|
|
|
+ rm -rf $@
|
|
|
|
|
+
|
|
|
|
|
+# 综合应用测试程序
|
|
|
|
|
+LIBS := -Wl,-Bstatic -L./swapi -lswapi -L./hk_takephoto -lhk_takephoto -L./air720u -lair720u -L./air530z -lair530z -L./ec200u -lec200u -L./dh_takephoto -ldh_takephoto
|
|
|
ifeq ($(target),armv7hf)
|
|
ifeq ($(target),armv7hf)
|
|
|
LIBS += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_takephoto/lib/armv7hf/. -lMvCameraControl
|
|
LIBS += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_takephoto/lib/armv7hf/. -lMvCameraControl
|
|
|
|
|
+ LIBS += -L$(PWD)/dh_takephoto/lib/armv7hf -lMVSDK -liImageProcessing -lImageConvert -llog4cpp -lMvLSCProcess
|
|
|
|
|
+ LIBS += -L$(PWD)/dh_takephoto/lib/armv7hf/GenICam/bin -lGCBase_gcc483_v3_0 -lGenApi_gcc483_v3_0 -lLog_gcc483_v3_0 -llog4cpp_gcc483_v3_0 -lMathParser_gcc483_v3_0 -lNodeMapData_gcc483_v3_0 -lXmlParser_gcc483_v3_0
|
|
|
else
|
|
else
|
|
|
LIBS += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_takephoto/lib/x86_64/64 -lMvCameraControl
|
|
LIBS += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_takephoto/lib/x86_64/64 -lMvCameraControl
|
|
|
endif
|
|
endif
|
|
@@ -104,6 +141,7 @@ rtu_linux_modules.out : libswapi.a libhk_takephoto.a libair720u.a libair530z.a l
|
|
|
clean :
|
|
clean :
|
|
|
make -C ./swapi clean
|
|
make -C ./swapi clean
|
|
|
make -C ./hk_takephoto clean
|
|
make -C ./hk_takephoto clean
|
|
|
|
|
+ make -C ./dh_takephoto clean
|
|
|
make -C ./air720u clean
|
|
make -C ./air720u clean
|
|
|
make -C ./air530z clean
|
|
make -C ./air530z clean
|
|
|
make -C ./ec200u clean
|
|
make -C ./ec200u clean
|