-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
180 lines (116 loc) · 6.83 KB
/
Makefile.in
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# Copyright 2021 Connor Horman
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Makefile.in template for library rust projects
# Root Options
ifeq ($(OS),Windows_NT)
DLLEXT = .dll
else
DLLEXT = .so
endif
srcdir = @srcdir@
builddir = @builddir@
abs_builddir = @abs_builddir@
RUSTC = @RUSTC@
RUSTFLAGS := @RUSTFLAGS@
INSTALL := @INSTALL@
RUSTC_IS_LCCC = @rustc_is_lccc@
libc = @libc@
## Install directories
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datarootdir = @datarootdir@
datadir = @datadir@
mandir = @mandir@
docdir = @docdir@
infodir = @infodir@
localedir = @localedir@
sysconfdir = @sysconfdir@
localstatedir = @localstatedir@
runstatedir = @runstatedir@
sharedstatedir = @sharedstatedir@
# Other Configuration
features =
binaries =
tests =
# Package specific Configuration
EXTRA_RUSTFLAGS =
# The package version
version =
# The output file of the library
OUTPUT = liblc-crypto.rlib
# The crate name of the library
CRATE_NAME = lc_crypto
# Any dependencies of the library
DEPENDENCIES = bytemuck zeroize $(libc)
PROC_MACROS =
SUBDIRS = vendor/bytemuck vendor/zeroize $(libc:%=vendor/%)
# Autogenerated variables
file_to_crate = $(subst -,_,$(1))
binary_outputs = $(foreach bin,$(binaries),$(bin)@EXEEXT@)
CFG = $(foreach feature,$(features),feature="$feature")
EXTERN_CRATES = $(foreach procmacro,$(PROC_MACROS),$(call file_to_crate,$(notdir $(procmacro)))=$(abs_builddir)/vendor/$(prcomacro)/lib$(procmacro).$(DLLEXT)) $(foreach dep,$(DEPENDENCIES),--extern $(call file_to_crate,$(notdir $(dep)))=$(abs_builddir)/vendor/$(dep)/lib$(dep).rlib)
export CARGO_PKG_VERSION=$(version)
export CARGO_MANIFEST_DIR=@abs_srcdir@
export OUT_DIR=@abs_builddir@
export MAKE
# Targets
all:
+@srcdir@/build-dirs.sh $(SUBDIRS)
+$(MAKE) stamp
.PHONY: all clean distclean install install-strip check check-local $(binary_outputs:%=install-%) $(binary_outputs:%=install-strip-%) $(foreach subdir,$(SUBDIRS),$(subdir)/install) $(foreach subdir,$(SUBDIRS),$(subdir)/install-strip) $(foreach subdir,$(SUBDIRS),$(subdir)/clean) $(foreach subdir,$(SUBDIRS),$(subdir)/distclean) $(foreach subdir,$(SUBDIRS),$(subdir)/check)
Makefile: config.status @srcdir@/Makefile.in
@builddir@/config.status Makefile
config.status: @srcdir@/configure
@builddir@/config.status --recheck
stamp: $(binaries) $(OUTPUT)
touch stamp
$(OUTPUT): Makefile
include $(OUTPUT).d
$(OUTPUT).d: $(srcdir)/src/lib.rs $(foreach subdir,$(SUBDIRS),$(subdir)/stamp)
$(RUSTC) $(RUSTFLAGS) $(EXTRA_RUSTFLAGS) $(foreach cfg,$(CFG),--cfg $(cfg)) --crate-name $(CRATE_NAME) --crate-type rlib --emit dep-info=@builddir@/$(OUTPUT).d -o$(OUTPUT) $< $(EXTERN_CRATES)
$(OUTPUT): $(srcdir)/src/lib.rs $(foreach subdir,$(SUBDIRS),$(subdir)/stamp)
+$(RUSTC) $(RUSTFLAGS) $(EXTRA_RUSTFLAGS) $(foreach cfg,$(CFG),--cfg $(cfg)) --crate-name $(CRATE_NAME) --crate-type rlib --emit dep-info=@builddir@/$(OUTPUT).d --emit link=@abs_builddir@/$(OUTPUT) -o$(OUTPUT) $< $(EXTERN_CRATES)
include $(foreach bin,$(binary_outputs),$(bin).d)
$(foreach out,$(binary_outputs),$(out).d): %@[email protected]: $(srcdir)/src/bin/%.rs $(OUTPUT)
$(RUSTC) $(RUSTFLAGS) $(EXTRA_RUSTFLAGS) $(foreach cfg,$(CFG),--cfg $(cfg)) --crate-name $(call file_to_crate,$*) --crate-type bin --emit dep-info=@builddir@/$@ -o$*@EXEEXT@ $< $(EXTERN_CRATES) --extern $(CRATE_NAME)=@abs_builddir@/$(OUTPUT)
$(binary_outputs): %@EXEEXT@: $(srcdir)/src/bin/%.rs $(OUTPUT)
+$(RUSTC) $(RUSTFLAGS) $(EXTRA_RUSTFLAGS) $(foreach cfg,$(CFG),--cfg $(cfg)) --crate-name $(call file_to_crate,$*) --crate-type bin --emit dep-info=@builddir@/[email protected] --emit link=@abs_builddir@/$@ -o$@ $< $(EXTERN_CRATES) --extern $(CRATE_NAME)=@abs_builddir@/$(OUTPUT)
clean: $(foreach subdir,$(SUBDIRS),$(subdir)/clean)
rm -f $(OUTPUT) $(binary_outputs) test-$(OUTPUT:%.rlib=%@EXEEXT@) $(tests:%.rs=%@EXEEXT@) stamp
distclean: clean $(foreach subdir,$(SUBDIRS),$(subdir)/distclean)
rm -f config.status config.log $(OUTPUT).d test-$(OUTPUT:%.rlib=%@EXEEXT@).d $(foreach out,$(binary_outputs),$(out).d) Makefile
$(binary_outputs:%=install-%): install-%: %
$(INSTALL) -m755 $< ${bindir}/
$(binary_outputs:%=install-strip-%): install-strip-%: %
$(INSTALL) -s -m755 $< ${bindir}/
install: $(binary_outputs:%=install-%) $(foreach subdir,$(SUBDIRS),$(subdir)/install)
install-strip: $(binary_outputs:%=install-strip-%) $(foreach subdir,$(SUBDIRS),$(subdir)/install-strip)
include test-$(OUTPUT:%.rlib=%@EXEEXT@).d
tests/:
mkdir tests/
test-$(OUTPUT:%.rlib=%@EXEEXT@).d: $(srcdir)/src/lib.rs Makefile $(foreach subdir,$(SUBDIRS),$(subdir)/stamp)
$(RUSTC) $(RUSTFLAGS) $(EXTRA_RUSTFLAGS) $(foreach cfg,$(CFG),--cfg $(cfg)) --cfg test --crate-name $(CRATE_NAME) --test --emit dep-info=@builddir@/test-$(OUTPUT:%.rlib=%@EXEEXT@).d -otest-$(OUTPUT:%.rlib=%@EXEEXT@) $< $(EXTERN_CRATES)
test-$(OUTPUT:%.rlib=%@EXEEXT@): $(srcdir)/src/lib.rs $(OUTPUT)
+$(RUSTC) $(RUSTFLAGS) $(EXTRA_RUSTFLAGS) $(foreach cfg,$(CFG),--cfg $(cfg)) --cfg test --crate-name $(CRATE_NAME) --test --emit dep-info=@builddir@/test-$(OUTPUT:%.rlib=%@EXEEXT@).d --emit link=@abs_builddir@/test-$(OUTPUT:%.rlib=%@EXEEXT@) -o$(OUTPUT:%.rlib=%@EXEEXT@) $< $(EXTERN_CRATES)
$(tests:%.rs=%@EXEEXT@): %@EXEEXT@: $(srcdir)/%.rs $(OUTPUT) tests/ Makefile
+$(RUSTC) $(RUSTFLAGS) $(EXTRA_RUSTFLAGS) $(foreach cfg,$(CFG),--cfg $(cfg)) --crate-name $(call file_to_crate,$(*F)) --test --emit dep-info=@builddir@/[email protected] --emit link=@abs_builddir@/$@ -o$@ $< $(EXTERN_CRATES) --extern $(CRATE_NAME)=@abs_builddir@/$(OUTPUT)
check: $(foreach subdir,$(SUBDIRS),$(subdir)/check) check-local
check-local: @builddir@/test-$(OUTPUT:%.rlib=%@EXEEXT@) $(tests:%.rs=@builddir@/%@EXEEXT@)
$(srcdir)/run-tests.sh $(foreach file,$^,@builddir@/$(file))
%/stamp: %/Makefile
+$(MAKE) -C $* stamp
%/clean:
+$(MAKE) -C $* clean
%/install:
+$(MAKE) -C $* install
%/install:
+$(MAKE) -C $* install-strip
%/check:
+$(MAKE) -C $* check