2012-09-08 08:54:32 +00:00
|
|
|
TARGET = omath
|
|
|
|
|
|
|
|
ROOT_DIR = .
|
|
|
|
|
|
|
|
SRC_DIR = $(ROOT_DIR)/src
|
|
|
|
SRC_CRATE = $(TARGET).rc
|
|
|
|
BUILD_DIR = $(ROOT_DIR)/lib
|
|
|
|
|
|
|
|
TEST = test_$(TARGET)
|
|
|
|
TEST_DIR = $(ROOT_DIR)/test
|
|
|
|
TEST_BUILD_DIR = $(TEST_DIR)/build
|
|
|
|
TEST_CRATE = $(TEST).rc
|
|
|
|
|
|
|
|
$(TARGET):
|
|
|
|
@echo "Building $(TARGET)"
|
2012-09-24 02:54:24 +00:00
|
|
|
@mkdir -p $(BUILD_DIR)
|
2012-09-08 08:54:32 +00:00
|
|
|
@rustc $(SRC_DIR)/$(SRC_CRATE) --lib -g --out-dir=$(BUILD_DIR)
|
|
|
|
@echo "Success! \o/"
|
|
|
|
|
|
|
|
all: $(TARGET)
|
2012-09-07 10:48:47 +00:00
|
|
|
|
|
|
|
test: all
|
2012-09-08 08:54:32 +00:00
|
|
|
@echo "..."
|
|
|
|
@echo "Building $(TEST)"
|
2012-09-24 02:54:24 +00:00
|
|
|
@mkdir -p $(TEST_BUILD_DIR)
|
2012-09-08 08:54:32 +00:00
|
|
|
@rustc --test -L lib $(TEST_DIR)/$(TEST_CRATE) -g --out-dir=$(TEST_BUILD_DIR)
|
|
|
|
@echo "Success! \o/"
|
|
|
|
@$(TEST_BUILD_DIR)/$(TEST)
|
|
|
|
|
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)
|