-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (25 loc) · 700 Bytes
/
Copy pathMakefile
File metadata and controls
40 lines (25 loc) · 700 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
# Makefile to convert UTF-8 source files 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
SRCS = $(wildcard $(SRC_DIR)/*)
SJ_SRCS = $(subst $(SRC_DIR)/,$(BLD_DIR)/,$(SRCS))
.PHONY: all directories srcdir_mk clean
all: directories $(SJ_SRCS)
directories: $(BLD_DIR)
$(BLD_DIR):
$(MKDIR_P) $@
$(BLD_DIR)/%: $(SRC_DIR)/%
$(U8TOSJ) < $^ >! $@
# 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)
clean:
rm -f $(SJ_SRCS)
-rmdir $(BLD_DIR)
# EOF