[5f4d9c3] | 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: |
---|
[cfdf333] | 31 | cd $(CUR_DIR)/conf && make; cd $(CUR_DIR) |
---|
[5f4d9c3] | 32 | |
---|
| 33 | .PHONY: libraries |
---|
| 34 | libraries: |
---|
| 35 | |
---|
| 36 | .PHONY: share |
---|
| 37 | share: |
---|
| 38 | |
---|
| 39 | # ------------------------------------------------------------------ |
---|
| 40 | # cleanup section |
---|
| 41 | # ------------------------------------------------------------------ |
---|
| 42 | .PHONY: clean |
---|
[e7de6cc] | 43 | clean: clean_components clean_documentation clean_config clean_config_mak |
---|
[5f4d9c3] | 44 | @echo "All files cleaned successfully!" |
---|
| 45 | |
---|
| 46 | .PHONY: clean_components |
---|
| 47 | clean_components: |
---|
| 48 | @for cmp in $(COMPONENTS); do \ |
---|
| 49 | cd $(SRC_DIR)/$$cmp && make clean; cd $(CUR_DIR); \ |
---|
| 50 | done |
---|
| 51 | cd $(SRC_DIR)/lib && make clean; cd $(CUR_DIR); |
---|
| 52 | |
---|
| 53 | .PHONY: clean_documentation |
---|
| 54 | clean_documentation: |
---|
| 55 | cd $(CUR_DIR)/doc && make clean; cd $(CUR_DIR) |
---|
| 56 | |
---|
[cfdf333] | 57 | .PHONY: clean_config |
---|
| 58 | clean_config: |
---|
| 59 | cd $(CUR_DIR)/conf && make clean; cd $(CUR_DIR) |
---|
| 60 | |
---|
[e7de6cc] | 61 | .PHONY: clean_config_mak |
---|
| 62 | clean_config_mak: |
---|
| 63 | rm config.mak || true |
---|
| 64 | |
---|
[5f4d9c3] | 65 | # ------------------------------------------------------------------ |
---|
| 66 | # install section |
---|
| 67 | # ------------------------------------------------------------------ |
---|
| 68 | .PHONY: install |
---|
| 69 | install: all install_dirs install_components install_configuration install_libraries install_documentation install_share |
---|
[cfdf333] | 70 | |
---|
[5f4d9c3] | 71 | .PHONY: install_dirs |
---|
| 72 | install_dirs: |
---|
| 73 | install -d $(PREFIX) \ |
---|
| 74 | $(BIN_DIR) \ |
---|
| 75 | $(CONF_DIR) \ |
---|
| 76 | $(LANG_DIR) \ |
---|
| 77 | $(LIB_DIR) \ |
---|
| 78 | $(DOC_DIR) \ |
---|
| 79 | $(SHARE_DIR)/info |
---|
| 80 | |
---|
| 81 | .PHONY: install_components |
---|
| 82 | install_components: components |
---|
| 83 | @for cmp in $(COMPONENTS); do \ |
---|
| 84 | cd $(SRC_DIR)/$$cmp && make install; cd $(CUR_DIR); \ |
---|
| 85 | done |
---|
| 86 | |
---|
| 87 | .PHONY: install_configuration |
---|
| 88 | install_configuration: configuration |
---|
| 89 | cd $(CUR_DIR)/conf && make install; cd $(CUR_DIR) |
---|
| 90 | |
---|
| 91 | .PHONY: install_libraries |
---|
| 92 | install_libraries: libraries |
---|
| 93 | cd $(CUR_DIR)/lib && make install; cd $(CUR_DIR) |
---|
| 94 | |
---|
| 95 | .PHONY: install_documentation |
---|
| 96 | install_documentation: documentation |
---|
| 97 | cd $(CUR_DIR)/doc && make install; cd $(CUR_DIR) |
---|
| 98 | |
---|
| 99 | .PHONY: install_share |
---|
| 100 | install_share: share |
---|
| 101 | cd $(CUR_DIR)/share && make install; cd $(CUR_DIR) |
---|
[18e1952] | 102 | echo grammar compilation... |
---|
| 103 | dgc |
---|
[5f4d9c3] | 104 | |
---|
| 105 | # ------------------------------------------------------------------ |
---|
| 106 | # uninstall section |
---|
| 107 | # ------------------------------------------------------------------ |
---|
| 108 | |
---|
| 109 | .PHONY: uninstall |
---|
| 110 | uninstall: uninstall_share uninstall_documentation uninstall_libraries uninstall_configuration uninstall_components uninstall_dirs |
---|
| 111 | |
---|
| 112 | .PHONY: uninstall_components |
---|
| 113 | uninstall_components: |
---|
| 114 | @for cmp in $(COMPONENTS); do \ |
---|
| 115 | cd $(SRC_DIR)/$$cmp && make uninstall; cd $(CUR_DIR); \ |
---|
| 116 | done |
---|
| 117 | |
---|
| 118 | .PHONY: uninstall_configuration |
---|
| 119 | uninstall_configuration: |
---|
| 120 | cd $(CUR_DIR)/conf && make uninstall; cd $(CUR_DIR) |
---|
| 121 | |
---|
| 122 | .PHONY: uninstall_libraries |
---|
| 123 | uninstall_libraries: |
---|
| 124 | cd $(CUR_DIR)/lib && make uninstall; cd $(CUR_DIR) |
---|
| 125 | |
---|
| 126 | .PHONY: uninstall_documentation |
---|
| 127 | uninstall_documentation: |
---|
| 128 | cd $(CUR_DIR)/doc && make uninstall; cd $(CUR_DIR) |
---|
| 129 | |
---|
| 130 | .PHONY: uninstall_share |
---|
| 131 | uninstall_share: |
---|
| 132 | cd $(CUR_DIR)/share && make uninstall; cd $(CUR_DIR) |
---|
| 133 | |
---|
| 134 | .PHONY: uninstall_dirs |
---|
| 135 | uninstall_dirs: uninstall_configuration uninstall_documentation uninstall_share uninstall_libraries |
---|
| 136 | rmdir $(CONF_DIR) |
---|
| 137 | rmdir $(DOC_DIR) |
---|
| 138 | rmdir $(LANG_DIR) |
---|
| 139 | rmdir $(LIB_DIR) |
---|