-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
46 lines (39 loc) · 1.34 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
HOST:=$(shell hostname)
ifeq ($(HOST), origin)
# running one our development machine
include /home/system/Development/Switch/Makefile.dfl
CXXFLAGS=$(CPPFLAGS_SANITY_DEBUG) -I./sss/
EOBJS:=
LDFLAGS:=-lswitch
CLEANUP_EXTRA:=
# Explicitly using a mySQL 5.7+ distribution client for <=5.6 distribution clients
# can't connect to mySQL servers via SSL
MYSQL_LIBS:=/usr/local/mysql-57/lib/libmysqlclient.a
TARGETS:=service client
else
CC:=clang
CXX:=clang++
CC:=$(CXX) # use clang++ for compiling c modules as well, because, syms.resolver
CXXFLAGS:=-std=c++1z -Wall -I./Switch/ -DSWITCH_MIN -Wno-unknown-pragmas -Wno-undefined-inline -Ofast
CFLAGS:=-xc++ -Ofast
LDFLAGS_TLS:=-ldl -lssl -lcrypto
LDFLAGS_SANITY:=
LDFLAGS:=
EOBJS:=Switch/text.o Switch/ext/ext_xxhash.o Switch/base64.o Switch/data.o Switch/switch_security.o
MYSQL_LIBS:=-lmysqlclient
CLEANUP_EXTRA:=rm -f $(EOBJS)
# We are only going to build service for now, not the C++ client, which depends on all kind of various Switch modules
# Will be enabled later though
TARGETS:=service
endif
all: $(TARGETS)
service: $(EOBJS) service.o
make -C sss/ libsss.a
$(CC) service.o $(EOBJS) -o kms $(LDFLAGS_SANITY) $(LDFLAGS) -pthread $(LDFLAGS_TLS) $(MYSQL_LIBS) sss/libsss.a
client: kms_client.o
ar rcs libkms.a kms_client.o
clean:
rm -f *.o kms
$(CLEANUP_EXTRA)
.o: .cpp
.PHONY: clean