Dan Walsh | 46d294f | 2012-01-27 14:00:34 -0500 | [diff] [blame] | 1 | SUBDIRS = src include utils man |
| 2 | |
Jason Zaman | 3eebfc2 | 2017-04-25 01:59:54 +0800 | [diff] [blame] | 3 | PKG_CONFIG ?= pkg-config |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 4 | DISABLE_SETRANS ?= n |
Stephen Smalley | 116a596 | 2016-09-29 15:44:10 -0400 | [diff] [blame] | 5 | DISABLE_RPM ?= n |
William Roberts | b5dd795 | 2016-09-28 12:17:59 -0400 | [diff] [blame] | 6 | ANDROID_HOST ?= n |
| 7 | ifeq ($(ANDROID_HOST),y) |
| 8 | override DISABLE_SETRANS=y |
William Roberts | adca103 | 2016-09-29 14:02:25 -0400 | [diff] [blame] | 9 | override DISABLE_BOOL=y |
William Roberts | b5dd795 | 2016-09-28 12:17:59 -0400 | [diff] [blame] | 10 | endif |
Guillem Jover | a273733 | 2012-11-20 16:27:55 +0100 | [diff] [blame] | 11 | ifeq ($(DISABLE_RPM),y) |
William Roberts | 9b3e18e | 2016-09-28 12:00:23 -0400 | [diff] [blame] | 12 | DISABLE_FLAGS+= -DDISABLE_RPM |
Guillem Jover | a273733 | 2012-11-20 16:27:55 +0100 | [diff] [blame] | 13 | endif |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 14 | ifeq ($(DISABLE_SETRANS),y) |
William Roberts | 9b3e18e | 2016-09-28 12:00:23 -0400 | [diff] [blame] | 15 | DISABLE_FLAGS+= -DDISABLE_SETRANS |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 16 | endif |
William Roberts | adca103 | 2016-09-29 14:02:25 -0400 | [diff] [blame] | 17 | ifeq ($(DISABLE_BOOL),y) |
| 18 | DISABLE_FLAGS+= -DDISABLE_BOOL |
| 19 | endif |
William Roberts | b5dd795 | 2016-09-28 12:17:59 -0400 | [diff] [blame] | 20 | export DISABLE_SETRANS DISABLE_RPM DISABLE_FLAGS ANDROID_HOST |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 21 | |
Janis Danisevskis | 50f0910 | 2016-09-15 17:14:33 +0100 | [diff] [blame] | 22 | USE_PCRE2 ?= n |
| 23 | ifeq ($(USE_PCRE2),y) |
Petr Lautrbach | 80d6927 | 2017-10-11 10:53:45 +0200 | [diff] [blame] | 24 | PCRE_MODULE := libpcre2-8 |
| 25 | PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 |
Janis Danisevskis | 50f0910 | 2016-09-15 17:14:33 +0100 | [diff] [blame] | 26 | else |
Petr Lautrbach | 80d6927 | 2017-10-11 10:53:45 +0200 | [diff] [blame] | 27 | PCRE_MODULE := libpcre |
Janis Danisevskis | 50f0910 | 2016-09-15 17:14:33 +0100 | [diff] [blame] | 28 | endif |
Petr Lautrbach | 80d6927 | 2017-10-11 10:53:45 +0200 | [diff] [blame] | 29 | PCRE_CFLAGS += $(shell $(PKG_CONFIG) --cflags $(PCRE_MODULE)) |
| 30 | PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs $(PCRE_MODULE)) |
| 31 | export PCRE_MODULE PCRE_CFLAGS PCRE_LDLIBS |
Janis Danisevskis | 50f0910 | 2016-09-15 17:14:33 +0100 | [diff] [blame] | 32 | |
William Roberts | 16c123f | 2016-10-17 16:24:08 -0400 | [diff] [blame] | 33 | OS := $(shell uname) |
| 34 | export OS |
| 35 | |
| 36 | ifeq ($(shell $(CC) -v 2>&1 | grep "clang"),) |
| 37 | COMPILER := gcc |
| 38 | else |
| 39 | COMPILER := clang |
| 40 | endif |
| 41 | export COMPILER |
| 42 | |
Dan Walsh | 46d294f | 2012-01-27 14:00:34 -0500 | [diff] [blame] | 43 | all install relabel clean distclean indent: |
| 44 | @for subdir in $(SUBDIRS); do \ |
| 45 | (cd $$subdir && $(MAKE) $@) || exit 1; \ |
| 46 | done |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 47 | |
| 48 | swigify: all |
Dan Walsh | 46d294f | 2012-01-27 14:00:34 -0500 | [diff] [blame] | 49 | $(MAKE) -C src swigify $@ |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 50 | |
| 51 | pywrap: |
Dan Walsh | 46d294f | 2012-01-27 14:00:34 -0500 | [diff] [blame] | 52 | $(MAKE) -C src pywrap $@ |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 53 | |
| 54 | rubywrap: |
Dan Walsh | 46d294f | 2012-01-27 14:00:34 -0500 | [diff] [blame] | 55 | $(MAKE) -C src rubywrap $@ |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 56 | |
| 57 | install-pywrap: |
Dan Walsh | 46d294f | 2012-01-27 14:00:34 -0500 | [diff] [blame] | 58 | $(MAKE) -C src install-pywrap $@ |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 59 | |
| 60 | install-rubywrap: |
Dan Walsh | 46d294f | 2012-01-27 14:00:34 -0500 | [diff] [blame] | 61 | $(MAKE) -C src install-rubywrap $@ |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 62 | |
Laurent Bigonville | 640edd6 | 2016-10-26 23:41:54 +0200 | [diff] [blame] | 63 | clean-pywrap: |
| 64 | $(MAKE) -C src clean-pywrap $@ |
| 65 | |
| 66 | clean-rubywrap: |
| 67 | $(MAKE) -C src clean-rubywrap $@ |
| 68 | |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 69 | test: |