-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
35 lines (27 loc) · 1.1 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
DOCSETS := love.fnl luajit.fnl lua_5_1.fnl lua_5_2.fnl lua_5_3.fnl
RAW_DOCSETS := $(addprefix build/,$(DOCSETS))
PROCESSED_DOCSETS := $(addprefix data/,$(DOCSETS))
FENNEL ?= fennel
LUA ?= lua
PARENT_DIR := $(realpath $(PWD)/..)
LUA_LOCAL := "$(PARENT_DIR)/?.lua;$(PARENT_DIR)/?/init.lua"
## set up paths so require('fnldocstor.foo') works
export FENNEL_PATH := "$(PARENT_DIR)/?.fnl;$(PARENT_DIR)/?/init.fnl;$(FENNEL_PATH)"
export LUA_PATH := "$(LUA_LOCAL);$(or $(LUA_PATH),;;)"
ifdef LUA_PATH_5_2
export LUA_PATH_5_2 := "$(LUA_LOCAL);$(or $(LUA_PATH_5_2),;;)"
endif
ifdef LUA_PATH_5_3
export LUA_PATH_5_3 := "$(LUA_LOCAL);$(or $(LUA_PATH_5_3),;;)"
endif
docs: $(PROCESSED_DOCSETS)
fetchdocs: ; $(FENNEL) ./build/docsets.fnl fetch
luabuild: $(PROCESSED_DOCSETS) init.fnl macros.fnl
fennel --compile --require-as-include --metadata init.fnl > fnldocstor.lua
clean:
rm -f $(RAW_DOCSETS)
$(RAW_DOCSETS):
$(FENNEL) ./build/docsets.fnl fetch $(basename $(notdir $@))
$(PROCESSED_DOCSETS): $(RAW_DOCSETS) build/docsets.fnl
$(FENNEL) ./build/docsets.fnl build $(basename $(notdir $@))
.PHONY: docs fetchdocs clean