-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.am
33 lines (26 loc) · 1.03 KB
/
Makefile.am
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
bin_PROGRAMS = cnc
cnc_SOURCES = src/postgres.c src/cnc.c src/config.c src/db.c src/log.c src/main.c src/util.c
cnc_LDADD = $(RUST_LIBS)
cnc_CFLAGS = -Iinclude -I/usr/include/postgresql/ -DCOMMIT_HASH=\"@COMMIT_HASH@\"
# Define Rust libraries and their paths
if MACOS
RUST_LIBS = rust/email/target/debug/libemail.dylib
else
RUST_LIBS = rust/email/target/debug/libemail.so
endif
# Use BUILT_SOURCES to ensure rust_libs is considered a prerequisite
BUILT_SOURCES = $(RUST_LIBS)
# Custom rule for building Rust libraries
$(RUST_LIBS):
sh ./scripts/build-rust-libs.sh
.PHONY: rust_libs
# Override the clean target to include Rust library cleaning
clean-local:
@for dir in rust/*; do \
(cd $$dir && cargo clean); \
done
check_PROGRAMS = test
test_SOURCES = src/cnc.c src/config.c src/db.c src/log.c src/postgres.c tests/cnc_test.c src/util.c
test_LDADD = $(RUST_LIBS)
test_CFLAGS = -Iinclude -I/usr/include/postgresql/ -Wno-return-type -Wno-alloc-size-larger-than -DCOMMIT_HASH=\"@COMMIT_HASH@\"
CLEANFILES = $(bin_PROGRAMS) $(check_PROGRAMS) *.o