-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (63 loc) · 2.47 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
#
# Name: Makefile
#
# Description: This is the top level Makefile for the pcdaemon
#
# Copyright: Copyright (C) 2019 by Demand Peripherals, Inc
# All rights reserved.
#
# License: This program is free software; you can redistribute it and/or
# modify it under the terms of the Version 2 of the GNU General
# Public License as published by the Free Software Foundation.
# GPL2.txt in the top level directory is a copy of this license.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# Define default command prefix and UI port
CPREFIX ?= pc
DEF_UIPORT ?= 8870
PREFIX ?= /usr/local
INST_BIN_DIR = $(PREFIX)/bin
INST_LIB_DIR = $(PREFIX)/lib/pc
UNAME_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
SO_FLAGS := -shared -Wl,-soname
SO_EXT := so
ifeq ($(UNAME_S), Darwin)
SO_FLAGS := -shared -Wl,-undefined -Wl,dynamic_lookup -Wl,-install_name
SO_EXT := dylib
endif
export SO_FLAGS
export SO_EXT
all:
mkdir -p build/bin
mkdir -p build/lib
mkdir -p build/obj
make CPREFIX=$(CPREFIX) DEF_UIPORT=$(DEF_UIPORT) -C drivers all
make CPREFIX=$(CPREFIX) DEF_UIPORT=$(DEF_UIPORT) -C fpga-drivers all
make INST_LIB_DIR=$(INST_LIB_DIR) DEF_UIPORT=$(DEF_UIPORT) \
CPREFIX=$(CPREFIX) -C daemon all
clean:
make -C drivers clean
make -C fpga-drivers clean
make -C daemon clean
rm -rf build core
install:
mkdir -p $(INST_LIB_DIR)
make INST_BIN_DIR=$(INST_BIN_DIR) INST_LIB_DIR=$(INST_LIB_DIR) \
CPREFIX=$(CPREFIX) DEF_UIPORT=$(DEF_UIPORT) -C drivers install
make INST_BIN_DIR=$(INST_BIN_DIR) INST_LIB_DIR=$(INST_LIB_DIR) \
CPREFIX=$(CPREFIX) DEF_UIPORT=$(DEF_UIPORT) -C fpga-drivers install
make INST_BIN_DIR=$(INST_BIN_DIR) INST_LIB_DIR=$(INST_LIB_DIR) \
CPREFIX=$(CPREFIX) DEF_UIPORT=$(DEF_UIPORT) -C daemon install
uninstall:
make INST_BIN_DIR=$(INST_BIN_DIR) INST_LIB_DIR=$(INST_LIB_DIR) \
CPREFIX=$(CPREFIX) DEF_UIPORT=$(DEF_UIPORT) -C drivers uninstall
make INST_BIN_DIR=$(INST_BIN_DIR) INST_LIB_DIR=$(INST_LIB_DIR) \
CPREFIX=$(CPREFIX) DEF_UIPORT=$(DEF_UIPORT) -C fpga-drivers uninstall
make INST_BIN_DIR=$(INST_BIN_DIR) INST_LIB_DIR=$(INST_LIB_DIR) \
CPREFIX=$(CPREFIX) DEF_UIPORT=$(DEF_UIPORT) -C daemon uninstall
rmdir $(INST_LIB_DIR)
.PHONY: clean install uninstall