-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
56 lines (42 loc) · 1.46 KB
/
Makefile
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
46
47
48
49
50
51
52
53
54
55
56
.PHONY: update_riot_repo update_riot_data install_python_requirements
.PHONY: build serve
RIOT_REPO_URL = "https://github.com/RIOT-OS/RIOT.git"
TOOLS_DIR = $(abspath _tools)
DATA_DIR = $(abspath _data)
_DEFAULT_RIOTBASE = $(abspath _RIOT)
RIOTBASE ?= $(_DEFAULT_RIOTBASE)
RIOT_FETCH_DATA_CMD = RIOTBASE=$(RIOTBASE) DATA_DIR=$(DATA_DIR) $(TOOLS_DIR)/fetch_riot_data.py
RIOT_DATA_FILES += $(DATA_DIR)/riot_boards.yml
RIOT_DATA_FILES += $(DATA_DIR)/riot_stats.yml
RIOT_DATA_FILES += $(DATA_DIR)/riot_contributors.yml
RIOT_DATA_FILES += $(DATA_DIR)/riot_drivers.yml
RIOT_DATA_FILES += $(DATA_DIR)/riot_drivers_cats.yml
RIOT_DATA_FILES += $(DATA_DIR)/riot_cpus.yml
WATCH ?= 0
ifeq ($(WATCH),1)
JEKYLL_BUILD_ARGS += --watch
endif
PRODUCTION ?= 0
ifeq ($(PRODUCTION),1)
JEKYLL_BUILD_ARGS += --config _config.yml,_config_production.yml
export JEKYLL_ENV=production
endif
# symlinks are disabled to prevent errors when running make serve
$(RIOTBASE):
@git clone -c core.symlinks=false $(RIOT_REPO_URL) $(RIOTBASE)
install_python_requirements:
@pip3 install -r $(TOOLS_DIR)/requirements.txt
update_riot_repo: $(RIOTBASE)
ifeq ($(RIOTBASE),$(_DEFAULT_RIOTBASE))
@git -C $(RIOTBASE) pull
endif
$(RIOT_DATA_FILES):
@$(RIOT_FETCH_DATA_CMD)
update_riot_data: update_riot_repo
@$(RIOT_FETCH_DATA_CMD)
clean_riot_data:
rm -f $(RIOT_DATA_FILES)
build: $(RIOT_DATA_FILES)
@bundle exec jekyll build $(JEKYLL_BUILD_ARGS)
serve: $(RIOT_DATA_FILES)
@bundle exec jekyll serve --livereload