# This file contains a make script for the Committr application
#
# Author: Josh McIntyre
#

# This block defines makefile variables
CORE_FILES=src/core/*.cs
CONFIG_FILE=src/config/app.config

BUILD_DIR=bin
BUILD_BIN=committr.exe
BUILD_CONFIG=committr.exe.config

CC=mcs
FLAGS=/reference:System.Configuration.dll

# This rule builds the application
build: $(CORE_FILES) 
	mkdir -p $(BUILD_DIR)
	$(CC) $(CORE_FILES) /out:$(BUILD_DIR)/$(BUILD_BIN) $(FLAGS)
	cp $(CONFIG_FILE) $(BUILD_DIR)/$(BUILD_CONFIG)

# This rule cleans the build directory
clean: $(BUILD_DIR)
	rm $(BUILD_DIR)/*
	rmdir $(BUILD_DIR)