summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 36 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b94eb6e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,36 @@
+# Tools
+
+CC = gcc
+INSTALL = install
+
+# Project
+
+NAME = code
+
+# Directories
+
+BIN = bin
+INCLUDE = include
+PREFIX ?= /usr/local
+
+# Sources
+
+SOURCES_BIN = canardcc
+SOURCES_INCLUDE = canard.h
+
+# Produced files
+
+INSTALL_BIN = $(PREFIX)/bin
+INSTALL_INCLUDE = $(PREFIX)/include
+OUTPUT_DIRS = $(sort $(dir $(INSTALL_BIN)) $(dir $(INSTALL_INCLUDE)))
+
+all: install
+
+$(OUTPUT_DIRS):
+ $(foreach dir,$(OUTPUT_DIRS),install -d $(dir))
+
+.PHONY: install
+install: $(OUTPUT_DIRS)
+ @echo " INSTALL"
+ $(foreach source,$(SOURCES_BIN),@install $(BIN)/$(source) $(INSTALL_BIN)/$(source))
+ $(foreach source,$(SOURCES_INCLUDE),@install $(INCLUDE)/$(source) $(INSTALL_INCLUDE)/$(source))