This repository has been archived by the owner on Nov 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 152
/
Copy pathMakefile
95 lines (73 loc) · 2.41 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
93
94
95
OBJECTS = stream_parser.o c_parser.o
TARGETS = stream_parser c_parser innochecksum_changer
SRCS = stream_parser.c include/mysql_def.h c_parser.c
INC_PATH = -I./include
LIBS = -pthread -lm
BINDIR ?= ./bin
CC ?= gcc
INSTALL ?=install
YACC = bison
LEX = flex
OS_VERSION ?= jammy
CFLAGS += -D_FILE_OFFSET_BITS=64 -Wall -g -O3 -pipe -fgnu89-inline
INSTALLFLAGS ?=-s
CentOS5 = $(findstring .el5,$(shell cat /proc/version))
ifeq ($(CentOS5), .el5)
CFLAGS += -DCentOS5
endif
all: $(TARGETS)
debug: LEX_DEBUG = -d
debug: YACC_DEBUG = -r all
debug: CFLAGS += -DDEBUG -DSTREAM_PARSER_DEBUG
debug: $(TARGETS)
stream_parser.o: stream_parser.c include/mysql_def.h
$(CC) $(CFLAGS) $(INC_PATH) -c $<
stream_parser: stream_parser.o
$(CC) $(CFLAGS) $(INC_PATH) $(LIB_PATH) $(LIBS) $(LDFLAGS) $< -o $@
sql_parser.o: sql_parser.c
$(CC) $(CFLAGS) $(INC_PATH) -c $<
sql_parser.c: sql_parser.y lex.yy.c
$(YACC) $(YACC_DEBUG) -o $@ $<
lex.yy.c: sql_parser.l
$(LEX) $(LEX_DEBUG) $<
c_parser.o: c_parser.c
$(CC) $(CFLAGS) $(INC_PATH) -c $<
tables_dict.o: tables_dict.c
$(CC) $(CFLAGS) $(INC_PATH) -c $<
print_data.o: print_data.c
$(CC) $(CFLAGS) $(INC_PATH) -c $<
check_data.o: check_data.c
$(CC) $(CFLAGS) $(INC_PATH) -c $<
c_parser: sql_parser.o c_parser.o tables_dict.o print_data.o check_data.o
$(CC) $(CFLAGS) $(LDFLAGS) $(INC_PATH) $(LIB_PATH) $^ -o $@ $(LIBS)
innochecksum_changer: innochecksum.c include/innochecksum.h
$(CC) $(CFLAGS) $(LDFLAGS) $(INC_PATH) -o $@ $<
sys_parser: sys_parser.c
@ which mysql_config || (echo "sys_parser needs mysql development package( either -devel or -dev)"; exit -1)
$(CC) -o $@ $< `mysql_config --cflags` `mysql_config --libs`
install: $(TARGETS)
$(INSTALL) $(INSTALLFLAGS) $(TARGETS) $(BINDIR)
clean:
rm -f $(OBJECTS) $(TARGETS) lex.yy.c sql_parser.c sql_parser.output sys_parser
rm -f *.o *.core
rm -rf omnibus-undrop-for-innodb/pkg/
package: ## Build package - OS_VERSION can be: focal, jammy.
@docker run \
-v $(shell pwd):/undrop-for-innodb \
--name builder_undrop \
--rm \
--env OS_VERSION=${OS_VERSION} \
"twindb/omnibus-ubuntu:${OS_VERSION}" \
bash -l /undrop-for-innodb/omnibus-undrop-for-innodb/omnibus_build.sh
docker-start:
@docker run \
-v $(shell pwd):/undrop-for-innodb \
-it \
--name builder_undrop \
--rm \
--dns 8.8.8.8 \
--dns 208.67.222.222 \
--env PLATFORM=${PLATFORM} \
--env OS_VERSION=${OS_VERSION} \
"twindb/omnibus-ubuntu:${OS_VERSION}" \
bash -l