-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile.common
46 lines (39 loc) · 1.39 KB
/
Makefile.common
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
# Installation:
#DESTDIR= (acts as prefix to other paths for installation)
HEADERDIR=/usr/include
LIBDIR=/usr/lib
VERSION=2.1.0
VERSION_MAJOR=2
export CXX CXXOPTS CXXLINKOPTS CXXTESTOPTS CXXTESTLINKOPTS THREADOPT SANITIZE
export HEADERDIR LIBDIR DESTDIR VERSION VERSION_MAJOR
all:
$(MAKE) -C cmake all
@echo "------------------------------"
@echo "Dasynq version $(VERSION)."
@echo "------------------------------"
@echo "This is a header-only library."
@echo "Use \"$(MAKE) check\" to build and run tests."
@echo "Use \"$(MAKE) install\" to install."
check:
$(MAKE) -C tests check
# pkg-config file:
dasynq.pc:
@echo "Writing dasynq.pc file."
@rm -f dasynq.pc
@echo "# Dasynq - event loop library" >> dasynq.pc
@echo "Name: Dasynq" >> dasynq.pc
@echo "Description: Thread-safe cross-platform event loop library in C++" >> dasynq.pc
@echo "Version: $(VERSION)" >> dasynq.pc
@echo "URL: http://github.com/davmac314/dasynq" >> dasynq.pc
@echo "Libs: $(CXXLINKOPTS)" >> dasynq.pc
@echo "Cflags: $(CXXOPTS) -I\"$(HEADERDIR)\"" >> dasynq.pc
install: dasynq.pc
install -d "$(DESTDIR)$(HEADERDIR)/dasynq" "$(DESTDIR)$(LIBDIR)/pkgconfig"
install -m644 include/dasynq/* "$(DESTDIR)$(HEADERDIR)/dasynq"
install -m644 include/dasynq.h "$(DESTDIR)$(HEADERDIR)"
install -m644 dasynq.pc "$(DESTDIR)$(LIBDIR)/pkgconfig"
$(MAKE) -C cmake install
clean:
rm -f *.o
$(MAKE) -C tests clean
$(MAKE) -C cmake clean