1SUBDIRS = src include utils man
2
3PKG_CONFIG ?= pkg-config
4DISABLE_SETRANS ?= n
5DISABLE_RPM ?= n
6ANDROID_HOST ?= n
7ifeq ($(ANDROID_HOST),y)
8	override DISABLE_SETRANS=y
9	override DISABLE_BOOL=y
10endif
11ifeq ($(DISABLE_RPM),y)
12	DISABLE_FLAGS+= -DDISABLE_RPM
13endif
14ifeq ($(DISABLE_SETRANS),y)
15	DISABLE_FLAGS+= -DDISABLE_SETRANS
16endif
17ifeq ($(DISABLE_BOOL),y)
18	DISABLE_FLAGS+= -DDISABLE_BOOL
19endif
20export DISABLE_SETRANS DISABLE_RPM DISABLE_FLAGS ANDROID_HOST
21
22USE_PCRE2 ?= n
23ifeq ($(USE_PCRE2),y)
24	PCRE_MODULE := libpcre2-8
25	PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8
26else
27	PCRE_MODULE := libpcre
28endif
29PCRE_CFLAGS += $(shell $(PKG_CONFIG) --cflags $(PCRE_MODULE))
30PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs $(PCRE_MODULE))
31export PCRE_MODULE PCRE_CFLAGS PCRE_LDLIBS
32
33OS := $(shell uname)
34export OS
35
36ifeq ($(shell $(CC) -v 2>&1 | grep "clang"),)
37COMPILER := gcc
38else
39COMPILER := clang
40endif
41export COMPILER
42
43all install relabel clean distclean indent:
44	@for subdir in $(SUBDIRS); do \
45		(cd $$subdir && $(MAKE) $@) || exit 1; \
46	done
47
48swigify: all
49	$(MAKE) -C src swigify $@
50
51pywrap:
52	$(MAKE) -C src pywrap $@
53
54rubywrap:
55	$(MAKE) -C src rubywrap $@
56
57install-pywrap:
58	$(MAKE) -C src install-pywrap $@
59
60install-rubywrap:
61	$(MAKE) -C src install-rubywrap $@
62
63clean-pywrap:
64	$(MAKE) -C src clean-pywrap $@
65
66clean-rubywrap:
67	$(MAKE) -C src clean-rubywrap $@
68
69test:
70