forked from IObundle/iob-timer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (57 loc) · 2.06 KB
/
Makefile
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#
# TOP MAKEFILE
#
#
# SIMULATE
#
TIMER_DIR:=.
include core.mk
sim:
ifeq ($(SIM_SERVER), localhost)
make -C $(SIM_DIR) run SIMULATOR=$(SIMULATOR)
else
ssh $(SIM_USER)@$(SIM_SERVER) "if [ ! -d $(USER)/$(REMOTE_ROOT_DIR) ]; then mkdir -p $(USER)/$(REMOTE_ROOT_DIR); fi"
make -C $(SIM_DIR) clean
rsync -avz --delete --exclude .git $(TIMER_DIR) $(SIM_USER)@$(SIM_SERVER):$(USER)/$(REMOTE_ROOT_DIR)
ssh $(SIM_USER)@$(SIM_SERVER) 'cd $(USER)/$(REMOTE_ROOT_DIR); make -C $(SIM_DIR) run SIMULATOR=$(SIMULATOR) SIM_SERVER=localhost'
endif
sim-waves:
gtkwave $(SIM_DIR)/timer.vcd &
sim-clean:
ifeq ($(SIM_SERVER), localhost)
make -C $(SIM_DIR) clean
else
rsync -avz --delete --exclude .git $(TIMER_DIR) $(SIM_USER)@$(SIM_SERVER):$(USER)/$(REMOTE_ROOT_DIR)
ssh $(SIM_USER)@$(SIM_SERVER) 'cd $(USER)/$(REMOTE_ROOT_DIR); make clean SIM_SERVER=localhost FPGA_SERVER=localhost'
endif
#
# IMPLEMENT FPGA
#
fpga:
ifeq ($(FPGA_SERVER), localhost)
make -C $(FPGA_DIR) run DATA_W=$(DATA_W)
else
ssh $(FPGA_USER)@$(FPGA_SERVER) "if [ ! -d $(USER)/$(REMOTE_ROOT_DIR) ]; then mkdir -p $(USER)/$(REMOTE_ROOT_DIR); fi"
rsync -avz --delete --exclude .git $(TIMER_DIR) $(FPGA_USER)@$(FPGA_SERVER):$(USER)/$(REMOTE_ROOT_DIR)
ssh $(FPGA_USER)@$(FPGA_SERVER) 'cd $(USER)/$(REMOTE_ROOT_DIR); make -C $(FPGA_DIR) run FPGA_FAMILY=$(FPGA_FAMILY) FPGA_SERVER=localhost'
mkdir -p $(FPGA_DIR)/$(FPGA_FAMILY)
scp $(FPGA_USER)@$(FPGA_SERVER):$(REMOTE_ROOT_DIR)/$(FPGA_DIR)/$(FPGA_FAMILY)/$(FPGA_LOG) $(FPGA_DIR)/$(FPGA_FAMILY)
endif
fpga-clean:
ifeq ($(FPGA_SERVER), localhost)
make -C $(FPGA_DIR) clean
else
rsync -avz --delete --exclude .git $(TIMER_DIR) $(FPGA_USER)@$(FPGA_SERVER):$(USER)/$(REMOTE_ROOT_DIR)
ssh $(FPGA_USER)@$(FPGA_SERVER) 'cd $(USER)/$(REMOTE_ROOT_DIR); make clean SIM_SERVER=localhost FPGA_SERVER=localhost'
endif
#
# DOCUMENT
#
doc:
make -C document/$(DOC_TYPE) $(DOC_TYPE).pdf
doc-clean:
make -C document/$(DOC_TYPE) clean
doc-pdfclean:
make -C document/$(DOC_TYPE) pdfclean
clean: sim-clean fpga-clean doc-clean
.PHONY: sim sim-waves fpga fpga_clean doc doc-clean doc-pdfclean clean