-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (32 loc) · 1.01 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
# Makefile for (V)TwentyOne.sys (convert source code from UTF-8 to Shift_JIS)
# Do not use non-ASCII characters in this file.
MKDIR_P = mkdir -p
U8TOSJ = u8tosj
SRCDIR_MK = srcdir.mk
SRC_DIR = src
-include $(SRCDIR_MK)
BLD_DIR = build
DOCS = twentyonesys.txt CHANGELOG.txt
SJ_DOCS = $(addprefix $(BLD_DIR)/,$(DOCS))
SRCS = $(wildcard $(SRC_DIR)/*)
SJ_SRCS = $(subst $(SRC_DIR)/,$(BLD_DIR)/,$(SRCS))
.PHONY: all clean directories srcdir_mk
all: directories $(SJ_DOCS) $(SJ_SRCS)
clean:
rm -f $(SJ_DOCS) $(SJ_SRCS)
-rmdir $(BLD_DIR)
directories: $(BLD_DIR)
# Do not use $(SRCDIR_MK) as the target name to prevent automatic remaking of the makefile.
srcdir_mk:
rm -f $(SRCDIR_MK)
echo "SRC_DIR = $(CURDIR)/src" > $(SRCDIR_MK)
$(BLD_DIR):
$(MKDIR_P) $@
# convert src/* (UTF-8) to build/* (Shift_JIS)
$(BLD_DIR)/%: $(SRC_DIR)/%
$(U8TOSJ) < $^ >! $@
$(BLD_DIR)/twentyonesys.txt: $(SRC_DIR)/../twentyonesys.md
$(U8TOSJ) < $^ >! $@
$(BLD_DIR)/CHANGELOG.txt: $(SRC_DIR)/../CHANGELOG.md
$(U8TOSJ) < $^ >! $@
# EOF