-
Notifications
You must be signed in to change notification settings - Fork 1
/
GNUmakefile
34 lines (29 loc) · 971 Bytes
/
GNUmakefile
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
VOC = /opt/voc/bin/voc
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir_path := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
ifndef BUILD
BUILD="build"
endif
build_dir_path := $(mkfile_dir_path)/$(BUILD)
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
BLD := $(mkfile_dir_path)/build
DPD = deps
ifndef DPS
DPS := $(mkfile_dir_path)/$(DPD)
endif
all: get_deps build_deps buildLists
get_deps:
mkdir -p $(DPS)
if [ -d $(DPS)/strutils ]; then cd $(DPS)/strutils; git pull; cd -; else cd $(DPS); git clone https://github.com/norayr/strutils; cd -; fi
build_deps:
mkdir -p $(BUILD)
cd $(BUILD)
make -f $(DPS)/strutils/GNUmakefile BUILD=$(BUILD)
buildLists:
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/List.Mod
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/StringList.Mod
tests:
cd $(BUILD) && $(VOC) $(mkfile_dir_path)/test/testList.Mod -m
build/testList
clean:
if [ -d "$(BUILD)" ]; then rm -rf $(BLD); fi