[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 | |
---|
| 22 | @for cmp in $(COMPONENTS); do\ |
---|
| 23 | cd $(SRC_DIR)/$$cmp && make; cd $(CUR_DIR); \ |
---|
| 24 | done |
---|
| 25 | |
---|
| 26 | .PHONY: documentation |
---|
| 27 | documentation: |
---|
| 28 | cd $(CUR_DIR)/doc && make; cd $(CUR_DIR) |
---|
| 29 | |
---|
| 30 | .PHONY: configuration |
---|
| 31 | configuration: |
---|
| 32 | |
---|
| 33 | .PHONY: libraries |
---|
| 34 | libraries: |
---|
| 35 | |
---|
| 36 | .PHONY: share |
---|
| 37 | share: |
---|
| 38 | |
---|
| 39 | # ------------------------------------------------------------------ |
---|
| 40 | # cleanup section |
---|
| 41 | # ------------------------------------------------------------------ |
---|
| 42 | .PHONY: clean |
---|
| 43 | clean: clean_components clean_documentation |
---|
| 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 | |
---|
| 57 | # ------------------------------------------------------------------ |
---|
| 58 | # install section |
---|
| 59 | # ------------------------------------------------------------------ |
---|
| 60 | .PHONY: install |
---|
| 61 | install: all install_dirs install_components install_configuration install_libraries install_documentation install_share |
---|
| 62 | |
---|
| 63 | .PHONY: install_dirs |
---|
| 64 | install_dirs: |
---|
| 65 | install -d $(PREFIX) \ |
---|
| 66 | $(BIN_DIR) \ |
---|
| 67 | $(CONF_DIR) \ |
---|
| 68 | $(LANG_DIR) \ |
---|
| 69 | $(LIB_DIR) \ |
---|
| 70 | $(DOC_DIR) \ |
---|
| 71 | $(SHARE_DIR)/info |
---|
| 72 | |
---|
| 73 | .PHONY: install_components |
---|
| 74 | install_components: components |
---|
| 75 | @for cmp in $(COMPONENTS); do \ |
---|
| 76 | cd $(SRC_DIR)/$$cmp && make install; cd $(CUR_DIR); \ |
---|
| 77 | done |
---|
| 78 | |
---|
| 79 | .PHONY: install_configuration |
---|
| 80 | install_configuration: configuration |
---|
| 81 | cd $(CUR_DIR)/conf && make install; cd $(CUR_DIR) |
---|
| 82 | |
---|
| 83 | .PHONY: install_libraries |
---|
| 84 | install_libraries: libraries |
---|
| 85 | cd $(CUR_DIR)/lib && make install; cd $(CUR_DIR) |
---|
| 86 | |
---|
| 87 | .PHONY: install_documentation |
---|
| 88 | install_documentation: documentation |
---|
| 89 | cd $(CUR_DIR)/doc && make install; cd $(CUR_DIR) |
---|
| 90 | |
---|
| 91 | .PHONY: install_share |
---|
| 92 | install_share: share |
---|
| 93 | cd $(CUR_DIR)/share && make install; cd $(CUR_DIR) |
---|
| 94 | |
---|
| 95 | # ------------------------------------------------------------------ |
---|
| 96 | # uninstall section |
---|
| 97 | # ------------------------------------------------------------------ |
---|
| 98 | |
---|
| 99 | .PHONY: uninstall |
---|
| 100 | uninstall: uninstall_share uninstall_documentation uninstall_libraries uninstall_configuration uninstall_components uninstall_dirs |
---|
| 101 | |
---|
| 102 | .PHONY: uninstall_components |
---|
| 103 | uninstall_components: |
---|
| 104 | @for cmp in $(COMPONENTS); do \ |
---|
| 105 | cd $(SRC_DIR)/$$cmp && make uninstall; cd $(CUR_DIR); \ |
---|
| 106 | done |
---|
| 107 | |
---|
| 108 | .PHONY: uninstall_configuration |
---|
| 109 | uninstall_configuration: |
---|
| 110 | cd $(CUR_DIR)/conf && make uninstall; cd $(CUR_DIR) |
---|
| 111 | |
---|
| 112 | .PHONY: uninstall_libraries |
---|
| 113 | uninstall_libraries: |
---|
| 114 | cd $(CUR_DIR)/lib && make uninstall; cd $(CUR_DIR) |
---|
| 115 | |
---|
| 116 | .PHONY: uninstall_documentation |
---|
| 117 | uninstall_documentation: |
---|
| 118 | cd $(CUR_DIR)/doc && make uninstall; cd $(CUR_DIR) |
---|
| 119 | |
---|
| 120 | .PHONY: uninstall_share |
---|
| 121 | uninstall_share: |
---|
| 122 | cd $(CUR_DIR)/share && make uninstall; cd $(CUR_DIR) |
---|
| 123 | |
---|
| 124 | .PHONY: uninstall_dirs |
---|
| 125 | uninstall_dirs: uninstall_configuration uninstall_documentation uninstall_share uninstall_libraries |
---|
| 126 | rmdir $(CONF_DIR) |
---|
| 127 | rmdir $(DOC_DIR) |
---|
| 128 | rmdir $(LANG_DIR) |
---|
| 129 | rmdir $(LIB_DIR) |
---|