aboutsummaryrefslogtreecommitdiffstats
path: root/src/build-data/makefile/gmake.in
blob: 97084c7d82c34ec9a2d13e5cbd4463d05808a818 (plain)
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
%{header_in}

# Object Files
LIBOBJS       = %{lib_objs}

CLIOBJS       = %{cli_objs}

TESTOBJS      = %{test_objs}

# Build Commands
%{lib_build_cmds}

%{cli_build_cmds}

%{test_build_cmds}

# Library targets

$(CLI): $(LIBRARIES) $(CLIOBJS)
	$(CLI_LINK_CMD) $(LDFLAGS) $(CLIOBJS) $(CLI_LINKS_TO) -o $(CLI)
	$(CLI_POST_LINK_CMD)

$(TEST): $(LIBRARIES) $(TESTOBJS)
	$(TEST_LINK_CMD) $(LDFLAGS) $(TESTOBJS) $(TEST_LINKS_TO) -o $(TEST)
	$(TEST_POST_LINK_CMD)

%{if build_static_lib}

%{out_dir}/%{static_lib_name}: $(LIBOBJS)
	$(AR) %{ar_options} $@ $(LIBOBJS)

%{endif}

%{if build_shared_lib}

SONAME_ABI = %{soname_abi}
DARWIN_COMPATIBILITY_VER = %{version_packed}.%{abi_rev}.0
DARWIN_CURRENT_VER       = %{version_packed}.%{abi_rev}.%{version_patch}

%{out_dir}/%{shared_lib_name}: $(LIBOBJS)
	$(LIB_LINK_CMD) $(LDFLAGS) $(LIBOBJS) $(LIB_LINKS_TO) -o $@
	cd %{out_dir} && ln -fs %{shared_lib_name} %{soname_base}
	cd %{out_dir} && ln -fs %{shared_lib_name} %{soname_patch}

%{endif}

%{if build_fuzzers}

# Fuzzer build commands

FUZZER_LINK_CMD = %{fuzzer_link_cmd}
FUZZER_LINKS_TO = %{link_to_botan} $(LIB_LINKS_TO) %{fuzzer_libs}
FUZZER_FLAGS    = $(LANG_FLAGS) $(CXXFLAGS) $(WARN_FLAGS)

%{fuzzer_build_cmds}

FUZZERS=%{fuzzer_bin}

fuzzers: libs $(FUZZERS)

fuzzer_corpus:
	git clone --depth=1 https://github.com/randombit/crypto-corpus.git fuzzer_corpus

fuzzer_corpus_zip: fuzzer_corpus
	./src/scripts/create_corpus_zip.py fuzzer_corpus %{fuzzobj_dir}

%{endif}