rsld/ctest/Makefile
2021-06-29 23:44:18 -05:00

24 lines
No EOL
403 B
Makefile

CC := clang
RUST_SOURCES := $(shell find .. -type f -name "*.rs")
SOURCES := $(shell find -type f -name "*.c")
OBJECTS := $(patsubst %.c, bin/%, $(SOURCES))
RSLD := $(shell pwd)/../target/debug/rsld
CFLAGS := -v -static -fuse-ld=$(RSLD)
all: $(OBJECTS)
$(RSLD): $(RUST_SOURCES)
cargo build
bin/%: %.c bin $(RSLD)
$(CC) $(CFLAGS) -o $@ $<
bin:
mkdir -p bin
clean:
rm -rf bin
.PHONY: all clean