source: Makefile @ acbabee

Last change on this file since acbabee was f600a02, checked in by Tomasz Obrebski <obrebski@…>, 11 years ago

Bugs in build and installation process fixed, lem.bin and gram.dgp built while compilation

  • Property mode set to 100644
File size: 3.9 KB
Line 
1include config.mak
2
3CUR_DIR=$(shell pwd)
4SRC_DIR=$(CUR_DIR)/src
5
6TARGETS = components configuration share libraries
7
8ifeq ($(BUILD_DOC), yes)
9        TARGETS += documentation
10endif
11
12.PHONY: all
13all: $(TARGETS)
14
15# ------------------------------------------------------------------
16# main section
17# ------------------------------------------------------------------
18.PHONY: components
19components:
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
26documentation:
27        cd $(CUR_DIR)/doc && make; cd $(CUR_DIR)
28
29.PHONY: configuration
30configuration:
31        cd $(CUR_DIR)/conf && make; cd $(CUR_DIR)
32
33.PHONY: libraries
34libraries:
35
36.PHONY: share
37share:
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
47clean: clean_components clean_share clean_documentation clean_config clean_config_mak
48        @echo "All files cleaned successfully!"
49
50.PHONY: clean_components
51clean_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
58clean_documentation:
59        cd $(CUR_DIR)/doc && make clean; cd $(CUR_DIR)
60
61.PHONY: clean_share
62clean_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
69clean_config:
70        cd $(CUR_DIR)/conf && make clean; cd $(CUR_DIR)
71
72.PHONY: clean_config_mak
73clean_config_mak:
74        rm config.mak || true
75
76# ------------------------------------------------------------------
77# install section
78# ------------------------------------------------------------------
79.PHONY: install
80install: all install_dirs install_components install_configuration install_libraries install_documentation install_share
81
82.PHONY: install_dirs
83install_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
93install_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
99install_configuration: configuration
100        cd $(CUR_DIR)/conf && make install; cd $(CUR_DIR)
101
102.PHONY: install_libraries
103install_libraries: libraries
104        cd $(CUR_DIR)/lib && make install; cd $(CUR_DIR)
105
106.PHONY: install_documentation
107install_documentation: documentation
108        cd $(CUR_DIR)/doc && make install; cd $(CUR_DIR)
109
110.PHONY: install_share
111install_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
122uninstall: uninstall_share uninstall_documentation uninstall_libraries uninstall_configuration uninstall_components uninstall_dirs
123
124.PHONY: uninstall_components
125uninstall_components:
126        @for cmp in $(COMPONENTS); do \
127                cd $(SRC_DIR)/$$cmp && make uninstall; cd $(CUR_DIR); \
128        done
129
130.PHONY: uninstall_configuration
131uninstall_configuration:
132        cd $(CUR_DIR)/conf && make uninstall; cd $(CUR_DIR)
133
134.PHONY: uninstall_libraries
135uninstall_libraries:
136        cd $(CUR_DIR)/lib && make uninstall; cd $(CUR_DIR)
137
138.PHONY: uninstall_documentation
139uninstall_documentation:
140        cd $(CUR_DIR)/doc && make uninstall; cd $(CUR_DIR)
141
142.PHONY: uninstall_share
143uninstall_share:
144        cd $(CUR_DIR)/share && make uninstall; cd $(CUR_DIR)
145
146.PHONY: uninstall_dirs
147uninstall_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)
Note: See TracBrowser for help on using the repository browser.