cgmath/Makefile

49 lines
1.4 KiB
Makefile
Raw Normal View History

# Copyright 2013 The Lmath Developers. For a full listing of the authors,
# refer to the AUTHORS file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
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
EXTERN_DIR = $(ROOT_DIR)/extern
2012-09-08 08:54:32 +00:00
BUILD_DIR = $(ROOT_DIR)/lib
2013-07-08 07:04:48 +00:00
CFG = --cfg=geom --cfg=noise --cfg=world
2013-07-08 07:00:38 +00:00
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):
@echo "Building $(TARGET)..."
@mkdir -p $(BUILD_DIR)
2013-07-08 07:00:38 +00:00
@rustc $(CFG) $(SRC_DIR)/$(SRC_CRATE) --out-dir=$(BUILD_DIR)
@echo "Success"
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:
@echo "Building unit tests for $(TARGET)..."
@mkdir -p $(TEST_BUILD_DIR)
2013-07-08 07:00:38 +00:00
@rustc $(CFG) $(SRC_DIR)/$(SRC_CRATE) --test --out-dir=$(TEST_BUILD_DIR)
@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:
rm -R -f $(BUILD_DIR)
rm -R -f $(TEST_BUILD_DIR)