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
|
|
|
|
SRC_CRATE = $(TARGET).rc
|
|
|
|
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)
|
2012-10-28 11:43:23 +00:00
|
|
|
@rustc $(SRC_DIR)/$(SRC_CRATE) --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)
|
2012-10-28 11:43:23 +00:00
|
|
|
@rustc $(SRC_DIR)/$(SRC_CRATE) --test --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)
|