~ruther/CTU-FEE-B0B35APO-Semestral-project

ref: 9f289a5b08da302d4c1a65c2fade4461ae9e848c CTU-FEE-B0B35APO-Semestral-project/Makefile -rw-r--r-- 1.6 KiB
9f289a5b — František Boháček feat: turn on red led on error 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
export ROOT_DIR = $(shell pwd)
export BIN_DIR = $(ROOT_DIR)/bin
export INHERIT_INCLUDES = -I$(ROOT_DIR)/lib-pheripherals/include
export LIB_DIR = -L$(ROOT_DIR)/bin

#TARGET_IP ?= 192.168.202.127
ifeq ($(TARGET_IP),)
ifneq ($(filter debug run,$(MAKECMDGOALS)),)
$(warning The target IP address is not set)
$(warning Run as "TARGET_IP=192.168.202.xxx make run" or modify Makefile)
TARGET_IP ?= 192.168.202.xxx
endif
endif
TARGET_DIR ?= /tmp/$(shell whoami)
TARGET_USER ?= root
# for use from Eduroam network use TARGET_IP=localhost and enable next line
#SSH_OPTIONS=-o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -o "Port=2222"
#SSH_GDB_TUNNEL_REQUIRED=y
SSH_OPTIONS+=-i ~/.ssh/mzapo-root-key
#SSH_OPTIONS=-i /opt/zynq/ssh-connect/mzapo-root-key
#SSH_OPTIONS=-o 'ProxyJump=ctu_login@postel.felk.cvut.cz'

all: image-viewer FORCE

image-viewer: FORCE lib-pheripherals
	@make -C image-viewer

lib-pheripherals: FORCE
	@make -C lib-pheripherals

copy-executable: all
	ssh $(SSH_OPTIONS) -t $(TARGET_USER)@$(TARGET_IP) killall gdbserver 1>/dev/null 2>/dev/null || true
	ssh $(SSH_OPTIONS) $(TARGET_USER)@$(TARGET_IP) mkdir -p $(TARGET_DIR)
	scp -r $(SSH_OPTIONS) $(BIN_DIR) $(TARGET_USER)@$(TARGET_IP):$(TARGET_DIR)/$(NAME)
	ssh $(SSH_OPTIONS) $(TARGET_USER)@$(TARGET_IP) mv $(TARGET_DIR)/bin/* $(TARGET_DIR)

run-image-viewer: copy-executable all 
	ssh $(SSH_OPTIONS) -t $(TARGET_USER)@$(TARGET_IP) LD_LIBRARY_PATH=$(TARGET_DIR) $(TARGET_DIR)/image-viewer $(ARG)

clean:
	@make -C image-viewer clean
	@make -C lib-pheripherals clean
	$(RM) -rf $(BIN_DIR)

FORCE: ;

.PHONY: clean all image-viewer FORCE copy-executable run-image-viewer
Do not follow this link