summaryrefslogtreecommitdiff
path: root/Makefile
blob: b94eb6e57ac5514c75474f8346f5f9b536231ce3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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))