-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathMakefile.in
142 lines (122 loc) · 4.07 KB
/
Makefile.in
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
include config.mk
LIB_DIR = lib
INC_DIR = src
DAT_DIR = share
SRC_DIR = src
HAVE_PYTHON = @HAVE_PYTHON@
HAVE_DOCKER = @HAVE_DOCKER@
CAN_BUILD_CXX_DOCS = @HAVE_CXX_DOCS@
CAN_BUILD_PYTHON_DOCS = @HAVE_PYTHON_DOCS@
BIFROST_PYTHON_DIR = python
all: libbifrost python
.PHONY: all
libbifrost:
$(MAKE) -C $(SRC_DIR) all
.PHONY: libbifrost
check:
ifeq ($(HAVE_PYTHON),1)
MYPYPATH=$(BIFROST_PYTHON_DIR) mypy --follow-imports=silent \
python/bifrost/blocks/detect.py \
python/bifrost/blocks/quantize.py \
python/bifrost/blocks/unpack.py \
python/bifrost/sigproc.py \
python/bifrost/sigproc2.py \
test/test_sigproc.py \
testbench/test_fft_detect.py
endif
.PHONY: check
test:
#$(MAKE) -C $(SRC_DIR) test
ifeq ($(HAVE_PYTHON),1)
cd test && ./download_test_data.sh ; @PYTHON@ -m unittest discover -v
endif
.PHONY: test
clean:
ifeq ($(HAVE_PYTHON),1)
$(MAKE) -C $(BIFROST_PYTHON_DIR) clean || true
endif
$(MAKE) -C $(SRC_DIR) clean
.PHONY: clean
install: $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO_MAJ_MIN) $(INSTALL_INC_DIR)/$(BIFROST_NAME) $(INSTALL_DAT_DIR)/$(BIFROST_NAME) $(INSTALL_LIB_DIR)/pkgconfig
ifeq ($(HAVE_PYTHON),1)
$(MAKE) -C $(BIFROST_PYTHON_DIR) install
endif
@echo "Libraries have been installed in:"
@echo " $(INSTALL_LIB_DIR)"
@echo ""
@echo "If you ever happen to want to link against installed libraries"
@echo "in a given directory, LIBDIR, you must either use libtool, and"
@echo "specify the full pathname of the library, or use the '-LLIBDIR'"
@echo "flag during linking and do at least one of the following:"
@echo " - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable"
@echo " during execution"
@echo " - add LIBDIR to the 'LD_RUN_PATH' environment variable"
@echo " during linking"
@echo " - use the '-Wl,-rpath -Wl,LIBDIR' linker flag"
@echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
@echo ""
@echo "See any operating system documentation about shared libraries for"
@echo "more information, such as the ld(1) and ld.so(8) manual pages."
.PHONY: install
uninstall:
rm -f $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO)
rm -f $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO_MAJ)
rm -f $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO_MAJ_MIN)
rm -rf $(INSTALL_INC_DIR)/bifrost/
rm -rf $(INSTALL_DAT_DIR)/bifrost/
rm -f $(INSTALL_LIB_DIR)/pkgconfig/bifrost.pc
ifeq ($(HAVE_PYTHON),1)
$(MAKE) -C $(BIFROST_PYTHON_DIR) uninstall
endif
.PHONY: uninstall
doc: $(INC_DIR)/bifrost/*.h Doxyfile docs/source/*.rst docs/source/*.py
ifeq ($(CAN_BUILD_CXX_DOCS),1)
@DX_DOXYGEN@ Doxyfile
endif
ifeq ($(CAN_BUILD_PYTHON_DOCS),1)
$(MAKE) -C docs singlehtml
endif
.PHONY: doc
python: libbifrost
ifeq ($(HAVE_PYTHON),1)
$(MAKE) -C $(BIFROST_PYTHON_DIR) build
endif
.PHONY: python
#GPU Docker build
IMAGE_NAME ?= ledatelescope/bifrost
docker:
ifeq ($(HAVE_DOCKER),1)
docker build --pull -t $(IMAGE_NAME):$(LIBBIFROST_MAJOR).$(LIBBIFROST_MINOR) -f Dockerfile.gpu -t $(IMAGE_NAME) .
endif
.PHONY: docker
#GPU Docker prereq build
# (To be used for testing new builds rapidly)
IMAGE_NAME ?= ledatelescope/bifrost
docker_prereq:
ifeq ($(HAVE_DOCKER),1)
docker build --pull -t $(IMAGE_NAME)_prereq:$(LIBBIFROST_MAJOR).$(LIBBIFROST_MINOR) -f Dockerfile_prereq.gpu -t $(IMAGE_NAME)_prereq .
endif
.PHONY: docker_prereq
#CPU-only Docker build
IMAGE_NAME ?= ledatelescope/bifrost
docker-cpu:
ifeq ($(HAVE_DOCKER),1)
docker build --pull -t $(IMAGE_NAME):$(LIBBIFROST_MAJOR).$(LIBBIFROST_MINOR) -f Dockerfile.cpu -t $(IMAGE_NAME) .
endif
.PHONY: docker
# TODO: Consider adding a mode 'develop=1' that makes symlinks instead of copying
# the library and headers.
$(INSTALL_LIB_DIR)/$(LIBBIFROST_SO_MAJ_MIN): $(LIB_DIR)/$(LIBBIFROST_SO_MAJ_MIN)
mkdir -p $(INSTALL_LIB_DIR)
cp $< $@
ln -f -s $(LIBBIFROST_SO_MAJ_MIN) $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO).$(LIBBIFROST_MAJOR)
ln -f -s $(LIBBIFROST_SO_MAJ_MIN) $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO)
$(INSTALL_INC_DIR)/bifrost: $(INC_DIR)/bifrost/*.h #$(INC_DIR)/bifrost/*.hpp
mkdir -p $@
cp $? $@/
$(INSTALL_DAT_DIR)/bifrost: $(DAT_DIR)/*.m4
mkdir -p $@
cp $? $@/
$(INSTALL_LIB_DIR)/pkgconfig: $(DAT_DIR)/*.pc
mkdir -p $@
cp $? $@/