2012-11-01 23:14:07 +00:00
|
|
|
TARGET = lmath
|
2012-09-08 08:54:32 +00:00
|
|
|
|
|
|
|
ROOT_DIR = .
|
|
|
|
|
|
|
|
SRC_DIR = $(ROOT_DIR)/src
|
2013-03-29 22:54:05 +00:00
|
|
|
SRC_CRATE = $(TARGET).rs
|
2013-03-31 20:56:46 +00:00
|
|
|
EXTERN_DIR = $(ROOT_DIR)/extern
|
2012-09-08 08:54:32 +00:00
|
|
|
BUILD_DIR = $(ROOT_DIR)/lib
|
|
|
|
|
2012-10-28 11:43:23 +00:00
|
|
|
TEST = $(TARGET)
|
|
|
|
TEST_BUILD_DIR = $(ROOT_DIR)/test
|
|
|
|
|
|
|
|
.PHONY: test
|
2012-09-08 08:54:32 +00:00
|
|
|
|
|
|
|
$(TARGET):
|
2012-11-01 13:08:40 +00:00
|
|
|
@echo "Building $(TARGET)..."
|
2012-09-24 02:54:24 +00:00
|
|
|
@mkdir -p $(BUILD_DIR)
|
2013-03-31 20:56:46 +00:00
|
|
|
@rustc $(SRC_DIR)/$(SRC_CRATE) -L $(EXTERN_DIR) --out-dir=$(BUILD_DIR)
|
2012-11-01 13:08:40 +00:00
|
|
|
@echo "Success"
|
2012-10-28 11:43:23 +00:00
|
|
|
|
2012-09-08 08:54:32 +00:00
|
|
|
all: $(TARGET)
|
2012-09-07 10:48:47 +00:00
|
|
|
|
2012-10-28 11:43:23 +00:00
|
|
|
test:
|
2012-11-01 13:08:40 +00:00
|
|
|
@echo "Building unit tests for $(TARGET)..."
|
2012-09-24 02:54:24 +00:00
|
|
|
@mkdir -p $(TEST_BUILD_DIR)
|
2013-03-31 20:56:46 +00:00
|
|
|
@rustc $(SRC_DIR)/$(SRC_CRATE) --test -L $(EXTERN_DIR) --out-dir=$(TEST_BUILD_DIR)
|
2012-11-01 13:08:40 +00:00
|
|
|
@echo "Success"
|
2012-10-28 11:43:23 +00:00
|
|
|
@$(TEST_BUILD_DIR)/$(TARGET)
|
2012-09-08 08:54:32 +00:00
|
|
|
|
2012-09-07 10:48:47 +00:00
|
|
|
clean:
|
2012-09-24 02:54:24 +00:00
|
|
|
rm -R -f $(BUILD_DIR)
|
|
|
|
rm -R -f $(TEST_BUILD_DIR)
|