-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
92 lines (74 loc) · 2.51 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
ROOT_DIR = .
HEADERS_DIR = Headers
SOURCE_DIR = Source
TOOLS_DIR = Tools
PARSER_DIR = $(TOOLS_DIR)/Parser
TESTER_DIR = $(TOOLS_DIR)/Tester
LIB_SHEENBIDI = sheenbidi
LIB_PARSER = sheenbidiparser
EXEC_TESTER = sheenbiditester
ifndef CC
CC = gcc
endif
ifndef CXX
CXX = g++
endif
AR = ar
ARFLAGS = -r
CFLAGS = -ansi -pedantic -Wall -I$(HEADERS_DIR)
CXXFLAGS = -std=c++11 -g -Wall
DEBUG_FLAGS = -DDEBUG -g -O0
RELEASE_FLAGS = -DNDEBUG -DSB_CONFIG_UNITY -Os
DEBUG = Debug
RELEASE = Release
DEBUG_SOURCES = $(SOURCE_DIR)/BidiChain.c \
$(SOURCE_DIR)/BidiTypeLookup.c \
$(SOURCE_DIR)/BracketQueue.c \
$(SOURCE_DIR)/GeneralCategoryLookup.c \
$(SOURCE_DIR)/IsolatingRun.c \
$(SOURCE_DIR)/LevelRun.c \
$(SOURCE_DIR)/PairingLookup.c \
$(SOURCE_DIR)/RunQueue.c \
$(SOURCE_DIR)/SBAlgorithm.c \
$(SOURCE_DIR)/SBBase.c \
$(SOURCE_DIR)/SBCodepointSequence.c \
$(SOURCE_DIR)/SBLine.c \
$(SOURCE_DIR)/SBLog.c \
$(SOURCE_DIR)/SBMirrorLocator.c \
$(SOURCE_DIR)/SBParagraph.c \
$(SOURCE_DIR)/SBScriptLocator.c \
$(SOURCE_DIR)/ScriptLookup.c \
$(SOURCE_DIR)/ScriptStack.c \
$(SOURCE_DIR)/StatusStack.c
RELEASE_SOURCES = $(SOURCE_DIR)/SheenBidi.c
DEBUG_OBJECTS = $(DEBUG_SOURCES:$(SOURCE_DIR)/%.c=$(DEBUG)/%.o)
RELEASE_OBJECTS = $(RELEASE_SOURCES:$(SOURCE_DIR)/%.c=$(RELEASE)/%.o)
DEBUG_TARGET = $(DEBUG)/lib$(LIB_SHEENBIDI).a
PARSER_TARGET = $(DEBUG)/lib$(LIB_PARSER).a
TESTER_TARGET = $(DEBUG)/$(EXEC_TESTER)
RELEASE_TARGET = $(RELEASE)/lib$(LIB_SHEENBIDI).a
all: release
release: $(RELEASE) $(RELEASE_TARGET)
debug: $(DEBUG) $(DEBUG_TARGET)
check: tester
./Debug/sheenbiditester Tools/Unicode
clean: parser_clean tester_clean
$(RM) $(DEBUG)/*.o
$(RM) $(DEBUG_TARGET)
$(RM) $(RELEASE)/*.o
$(RM) $(RELEASE_TARGET)
$(DEBUG):
mkdir $(DEBUG)
$(RELEASE):
mkdir $(RELEASE)
$(DEBUG_TARGET): $(DEBUG_OBJECTS)
$(AR) $(ARFLAGS) $(DEBUG_TARGET) $(DEBUG_OBJECTS)
$(RELEASE_TARGET): $(RELEASE_OBJECTS)
$(AR) $(ARFLAGS) $(RELEASE_TARGET) $(RELEASE_OBJECTS)
$(DEBUG)/%.o: $(SOURCE_DIR)/%.c
$(CC) $(CFLAGS) $(EXTRA_FLAGS) $(DEBUG_FLAGS) -c $< -o $@
$(RELEASE)/%.o: $(SOURCE_DIR)/%.c
$(CC) $(CFLAGS) $(EXTRA_FLAGS) $(RELEASE_FLAGS) -c $< -o $@
.PHONY: all check clean compiler debug parser release tester
include $(PARSER_DIR)/Makefile
include $(TESTER_DIR)/Makefile