1 | include config.mak |
---|
2 | |
---|
3 | CUR_DIR=$(shell pwd) |
---|
4 | SRC_DIR=$(CUR_DIR)/src |
---|
5 | |
---|
6 | TARGETS = components configuration share libraries |
---|
7 | |
---|
8 | ifeq ($(BUILD_DOC), yes) |
---|
9 | TARGETS += documentation |
---|
10 | endif |
---|
11 | |
---|
12 | .PHONY: all |
---|
13 | all: $(TARGETS) |
---|
14 | |
---|
15 | # ------------------------------------------------------------------ |
---|
16 | # main section |
---|
17 | # ------------------------------------------------------------------ |
---|
18 | .PHONY: components |
---|
19 | components: |
---|
20 | cd $(SRC_DIR)/lib && make; cd $(CUR_DIR) |
---|
21 | @for cmp in $(COMPONENTS); do\ |
---|
22 | cd $(SRC_DIR)/$$cmp && make; cd $(CUR_DIR); \ |
---|
23 | done |
---|
24 | |
---|
25 | .PHONY: documentation |
---|
26 | documentation: |
---|
27 | cd $(CUR_DIR)/doc && make; cd $(CUR_DIR) |
---|
28 | |
---|
29 | .PHONY: configuration |
---|
30 | configuration: |
---|
31 | cd $(CUR_DIR)/conf && make; cd $(CUR_DIR) |
---|
32 | |
---|
33 | .PHONY: libraries |
---|
34 | libraries: |
---|
35 | |
---|
36 | .PHONY: share |
---|
37 | share: |
---|
38 | @for lang in $(LANGUAGES); do\ |
---|
39 | cd $(CUR_DIR)/share/$$lang && make; cd $(CUR_DIR); \ |
---|
40 | done |
---|
41 | cd $(CUR_DIR)/share && make; cd $(CUR_DIR) |
---|
42 | |
---|
43 | # ------------------------------------------------------------------ |
---|
44 | # cleanup section |
---|
45 | # ------------------------------------------------------------------ |
---|
46 | .PHONY: clean |
---|
47 | clean: clean_components clean_share clean_documentation clean_config clean_config_mak |
---|
48 | @echo "All files cleaned successfully!" |
---|
49 | |
---|
50 | .PHONY: clean_components |
---|
51 | clean_components: |
---|
52 | @for cmp in $(COMPONENTS); do \ |
---|
53 | cd $(SRC_DIR)/$$cmp && make clean; cd $(CUR_DIR); \ |
---|
54 | done |
---|
55 | cd $(SRC_DIR)/lib && make clean; cd $(CUR_DIR); |
---|
56 | |
---|
57 | .PHONY: clean_documentation |
---|
58 | clean_documentation: |
---|
59 | cd $(CUR_DIR)/doc && make clean; cd $(CUR_DIR) |
---|
60 | |
---|
61 | .PHONY: clean_share |
---|
62 | clean_share: |
---|
63 | @for lang in $(LANGUAGES); do\ |
---|
64 | cd $(CUR_DIR)/share/$$lang && make clean; cd $(CUR_DIR); \ |
---|
65 | done |
---|
66 | cd $(CUR_DIR)/share && make clean; cd $(CUR_DIR) |
---|
67 | |
---|
68 | .PHONY: clean_config |
---|
69 | clean_config: |
---|
70 | cd $(CUR_DIR)/conf && make clean; cd $(CUR_DIR) |
---|
71 | |
---|
72 | .PHONY: clean_config_mak |
---|
73 | clean_config_mak: |
---|
74 | rm config.mak || true |
---|
75 | |
---|
76 | # ------------------------------------------------------------------ |
---|
77 | # install section |
---|
78 | # ------------------------------------------------------------------ |
---|
79 | .PHONY: install |
---|
80 | install: all install_dirs install_components install_configuration install_libraries install_documentation install_share |
---|
81 | |
---|
82 | .PHONY: install_dirs |
---|
83 | install_dirs: |
---|
84 | install -d $(PREFIX) \ |
---|
85 | $(BIN_DIR) \ |
---|
86 | $(CONF_DIR) \ |
---|
87 | $(LANG_DIR) \ |
---|
88 | $(LIB_DIR) \ |
---|
89 | $(DOC_DIR) \ |
---|
90 | $(SHARE_DIR)/info |
---|
91 | |
---|
92 | .PHONY: install_components |
---|
93 | install_components: components |
---|
94 | @for cmp in $(COMPONENTS); do \ |
---|
95 | cd $(SRC_DIR)/$$cmp && make install; cd $(CUR_DIR); \ |
---|
96 | done |
---|
97 | |
---|
98 | .PHONY: install_configuration |
---|
99 | install_configuration: configuration |
---|
100 | cd $(CUR_DIR)/conf && make install; cd $(CUR_DIR) |
---|
101 | |
---|
102 | .PHONY: install_libraries |
---|
103 | install_libraries: libraries |
---|
104 | cd $(CUR_DIR)/lib && make install; cd $(CUR_DIR) |
---|
105 | |
---|
106 | .PHONY: install_documentation |
---|
107 | install_documentation: documentation |
---|
108 | cd $(CUR_DIR)/doc && make install; cd $(CUR_DIR) |
---|
109 | |
---|
110 | .PHONY: install_share |
---|
111 | install_share: share |
---|
112 | cd $(CUR_DIR)/share && make install; cd $(CUR_DIR) |
---|
113 | #dictionaries compilation... |
---|
114 | #compdic |
---|
115 | #grammar compilation... |
---|
116 | |
---|
117 | # ------------------------------------------------------------------ |
---|
118 | # uninstall section |
---|
119 | # ------------------------------------------------------------------ |
---|
120 | |
---|
121 | .PHONY: uninstall |
---|
122 | uninstall: uninstall_share uninstall_documentation uninstall_libraries uninstall_configuration uninstall_components uninstall_dirs |
---|
123 | |
---|
124 | .PHONY: uninstall_components |
---|
125 | uninstall_components: |
---|
126 | @for cmp in $(COMPONENTS); do \ |
---|
127 | cd $(SRC_DIR)/$$cmp && make uninstall; cd $(CUR_DIR); \ |
---|
128 | done |
---|
129 | |
---|
130 | .PHONY: uninstall_configuration |
---|
131 | uninstall_configuration: |
---|
132 | cd $(CUR_DIR)/conf && make uninstall; cd $(CUR_DIR) |
---|
133 | |
---|
134 | .PHONY: uninstall_libraries |
---|
135 | uninstall_libraries: |
---|
136 | cd $(CUR_DIR)/lib && make uninstall; cd $(CUR_DIR) |
---|
137 | |
---|
138 | .PHONY: uninstall_documentation |
---|
139 | uninstall_documentation: |
---|
140 | cd $(CUR_DIR)/doc && make uninstall; cd $(CUR_DIR) |
---|
141 | |
---|
142 | .PHONY: uninstall_share |
---|
143 | uninstall_share: |
---|
144 | cd $(CUR_DIR)/share && make uninstall; cd $(CUR_DIR) |
---|
145 | |
---|
146 | .PHONY: uninstall_dirs |
---|
147 | uninstall_dirs: uninstall_configuration uninstall_documentation uninstall_share uninstall_libraries |
---|
148 | rmdir $(CONF_DIR) |
---|
149 | rmdir $(DOC_DIR) |
---|
150 | rmdir $(LANG_DIR) |
---|
151 | rmdir $(LIB_DIR) |
---|