This repository has been archived by the owner on Apr 28, 2023. It is now read-only.
forked from Mars999/regal
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.pcrelib
62 lines (47 loc) · 1.48 KB
/
Makefile.pcrelib
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
#
# Makefile for the GLSL Optimizer component of the Regal runtime.
# The GLSL Optimizer is always build into Regal, but you can build
# just this target static library with:
# make -f Makefile.pcrelib
#
ifndef MAKEFILE_PCRE_INCLUDED
MAKEFILE_PCRE_INCLUDED := 1
.PHONY: pcre.lib pcre.clean
include build/common.inc
include build/pcre.inc
ifdef PCRE.STATIC
all:: pcre.lib
clean:: pcre.clean
PCRE.SRCS := $(PCRE.C)
PCRE.SRCS := $(filter %.c,$(PCRE.SRCS)) $(filter %.cc,$(PCRE.SRCS)) $(filter %.cpp,$(PCRE.SRCS))
PCRE.SRCS.NAMES := $(notdir $(PCRE.SRCS))
PCRE.OBJS := $(addprefix tmp/$(SYSTEM)/pcre/static/,$(PCRE.SRCS.NAMES))
PCRE.OBJS := $(PCRE.OBJS:.c=.o) $(PCRE.OBJS:.cpp=.o)
PCRE.OBJS := $(filter %.o,$(PCRE.OBJS))
PCRE.DEPS := $(PCRE.OBJS:.o=.d)
PCRE.CFLAGS := $(PCRE.INCLUDE)
PCRE.CFLAGS += -DHAVE_CONFIG_H
PCRE.CFLAGS += -fvisibility=hidden
ifeq ($(MODE),release)
PCRE.CFLAGS += -DNDEBUG
PCRE.CFLAGS += -DREGAL_NO_ASSERT=1
endif
-include $(PCRE.DEPS)
pcre.lib: lib/$(SYSTEM)/$(PCRE.STATIC)
pcre.clean:
$(RM) -r tmp/$(SYSTEM)/pcre/static
$(RM) -r lib/$(SYSTEM)/$(PCRE.STATIC)
tmp/$(SYSTEM)/pcre/static/%.o: src/pcre/%.c
@mkdir -p $(dir $@)
$(LOG_CC)$(CCACHE) $(CC) $(CFLAGS) $(PCRE.CFLAGS) $(PICFLAG) -o $@ -c $<
lib/$(SYSTEM)/$(PCRE.STATIC): $(PCRE.OBJS)
@mkdir -p $(dir $@)
$(LOG_AR)$(CCACHE) $(AR) cr $@ $(PCRE.OBJS)
ifneq ($(RANLIB),)
$(LOG_RANLIB)$(RANLIB) $@
endif
ifneq ($(STRIP),)
$(LOG_STRIP)$(STRIP) -x $@
endif
endif
endif