-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (33 loc) · 739 Bytes
/
Makefile
File metadata and controls
45 lines (33 loc) · 739 Bytes
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
37
38
39
40
41
42
43
44
45
prefix ?= /usr
destdir ?= ${prefix}
arch ?=
static ?= false
linker ?=
PONYC ?= ponyc
BUILD_DIR ?= bin
SRC_DIR ?= lutra
binary := $(BUILD_DIR)/lutra
ifneq ($(arch),)
arch_arg := --cpu $(arch)
endif
ifdef static
ifeq (,$(filter $(static),true false))
$(error "static must be true or false)"
endif
endif
ifeq ($(static),true)
LINKER += --static
endif
SOURCE_FILES := $(shell find $(SRC_DIR) -path $(SRC_DIR)/test -prune -o -name \*.pony)
$(binary): $(SOURCE_FILES)
${PONYC} $(SRC_DIR) -o ${BUILD_DIR}
$(BUILD_DIR):
-mkdir -p $(BUILD_DIR)
install: $(binary)
@echo "install $(binary) to "
@mkdir -p $(DESTDIR)$(prefix)/bin
@cp $^ $(DESTDIR)$(prefix)/bin
clean:
rm -rf $(BUILD_DIR)
all: $(binary) install
.PHONY: all