-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
65 lines (48 loc) · 1.51 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
57
58
59
60
61
62
63
64
65
#
# Makefile
#
#
#
###########################
TARGET=conv
SOURCE=CobuildConv.cpp
COBUILD=/Volumes/COBUILD5/data/hcp_en-cc5.trd
# You need to edit these values.
DICT_NAME = "COBUILD"
DICT_SRC_PATH = cobuild.xml
CSS_PATH = cobuild.css
PLIST_PATH = cobuild.plist
DICT_BUILD_OPTS =
# Suppress adding supplementary key.
# DICT_BUILD_OPTS = -s 0 # Suppress adding supplementary key.
###########################
# The DICT_BUILD_TOOL_DIR value is used also in "build_dict.sh" script.
# You need to set it when you invoke the script directly.
DICT_BUILD_TOOL_DIR = "/Developer/Extras/Dictionary Development Kit"
DICT_BUILD_TOOL_BIN = "$(DICT_BUILD_TOOL_DIR)/bin"
###########################
DICT_DEV_KIT_OBJ_DIR = ./objects
export DICT_DEV_KIT_OBJ_DIR
DESTINATION_FOLDER = ~/Library/Dictionaries
RM = /bin/rm
###########################
$(TARGET): $(SOURCE)
$(CXX) -g -o $(TARGET) $(SOURCE)
$(DICT_SRC_PATH): $(TARGET)
./$(TARGET) $(COBUILD)
dic: $(DICT_SRC_PATH)
"$(DICT_BUILD_TOOL_BIN)/build_dict.sh" $(DICT_BUILD_OPTS) $(DICT_NAME) $(DICT_SRC_PATH) $(CSS_PATH) $(PLIST_PATH)
echo "Done."
install:
echo "Installing into $(DESTINATION_FOLDER)".
mkdir -p $(DESTINATION_FOLDER)
ditto --noextattr --norsrc $(DICT_DEV_KIT_OBJ_DIR)/$(DICT_NAME).dictionary $(DESTINATION_FOLDER)/$(DICT_NAME).dictionary
touch $(DESTINATION_FOLDER)
echo "Done."
echo "To test the new dictionary, try Dictionary.app."
clean:
$(RM) -rf $(DICT_DEV_KIT_OBJ_DIR)
rm -f $(TARGET)
rm -fr $(TARGET).dSYM
rm -f $(WORKDIR)
rm -f $(DICT_SRC_PATH)