32 lines
549 B
Makefile
32 lines
549 B
Makefile
VPATH=%VPATH%
|
|
|
|
CC ?= gcc
|
|
CXX ?= g++
|
|
CXXFLAGS ?=
|
|
AR ?= ar
|
|
RUSTC ?= rustc
|
|
RUSTFLAGS ?=
|
|
|
|
RUST_SRC=$(shell find $(VPATH)/. -type f -name '*.rs')
|
|
|
|
.PHONE: all
|
|
all: librustcorefoundation.dummy
|
|
|
|
%.o: %.c
|
|
$(CC) $< -o $@ -c $(CFLAGS)
|
|
|
|
librustcorefoundation.dummy: core_foundation.rc $(RUST_SRC)
|
|
$(RUSTC) $(RUSTFLAGS) $< -o $@
|
|
touch $@
|
|
|
|
rustcorefoundation-test: core_foundation.rc $(RUST_SRC)
|
|
$(RUSTC) $(RUSTFLAGS) $< -o $@ --test
|
|
|
|
check: rustcorefoundation-test
|
|
./rustcorefoundation-test
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -f *.o *.a *.so *.dylib *.dll *.dummy
|
|
|