aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: f1a577d7f6c9c9a095468ab1b9288ee4a07245e5 (plain) (blame)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
CURRENT_DIR = $(shell pwd)

MEOWPP_DIR = $(CURRENT_DIR)/meowpp
MEOWJS_DIR = $(CURRENT_DIR)/meowjs

TEMPLATE_DIRS = $(MEOWPP_DIR) $(MEOWJS_DIR)

###########################################################

README_SOURCE_DIR = $(CURRENT_DIR)/.readme
README_SOURCE = $(shell echo $(README_SOURCE_DIR)/*.asciidoc | sort)
README = $(CURRENT_DIR)/README.asciidoc
README_HTML = $(CURRENT_DIR)/README.html

###########################################################

DOXYGEN_CONFIG_PATH = $(CURRENT_DIR)/.doxygen
DOXYGEN_CONFIG_FILE = $(DOXYGEN_CONFIG_PATH)/config
DOXYGEN_INPUT_DIRS = $(TEMPLATE_DIRS)
DOXYGEN_OUTPUT_DIR = $(CURRENT_DIR)/doc

###########################################################

.PHONY: all install clean

all: readme doc

install:
    @echo 'Not implement yet.' && exit 1

clean: test_clean doc_clean

readme: $(README) $(README_HTML)

doc: document

doc_clean: document_clean

test: meowpp_test meowjs_test

test_clean: meowpp_test_clean meowjs_test_clean

###########################################################

include $(README_SOURCE_DIR)/Makefile
include $(DOXYGEN_CONFIG_PATH)/Makefile
include $(MEOWPP_DIR)/Makefile
include $(MEOWJS_DIR)/Makefile

###########################################################

clean_space:
    find $(TEMPLATE_DIRS) $(README_SOURCE_DIR) -type f |        \
    while read -r f;  do                        \
        cat "$$f" | sed -e 's/[\t ]*$$//g' > tmp_file.$$$$; \
        cat tmp_file.$$$$ > "$$f";              \
    done;                               \
    rm tmp_file.$$$$

increase_project_number3: /bin/bash
    num=$$(                             \
        cat $(DOXYGEN_CONFIG_FILE)  |               \
        grep 'PROJECT_NUMBER'   |               \
        sed -e 's/^.*=[^.]*\.[^.]*\.\(.*\)$$/\1/g'          \
        );                              \
    cat $(DOXYGEN_CONFIG_FILE) | sed -e 's/^\(PROJECT_NUMBER *=[^.]*\.[^.]*\.\).*$$/\1'$$(($$num + 1))'/g' > tmp.$$$$; \
    cat tmp.$$$$ > $(DOXYGEN_CONFIG_FILE);              \
    rm tmp.$$$$

increase_project_number2: /bin/bash
    num=$$(                             \
        cat $(DOXYGEN_CONFIG_FILE)  |               \
        grep 'PROJECT_NUMBER'   |               \
        sed -e 's/^.*=[^.]*\.\([^.]*\).*$$/\1/g'            \
        );                              \
    cat $(DOXYGEN_CONFIG_FILE) | sed -e 's/^\(PROJECT_NUMBER *=[^.]*\.\)[^.]*\..*$$/\1'$$(($$num + 1))'.-1/g' > tmp.$$$$; \
    cat tmp.$$$$ > $(DOXYGEN_CONFIG_FILE);              \
    rm tmp.$$$$

increase_project_number1: /bin/bash
    num=$$(                             \
        cat $(DOXYGEN_CONFIG_FILE)  |               \
        grep 'PROJECT_NUMBER'   |               \
        sed -e 's/^.*= *\([^.]*\).*$$/\1/g'             \
        );                              \
    cat $(DOXYGEN_CONFIG_FILE) | sed -e 's/^\(PROJECT_NUMBER[= ]*\)\([^.]*\).*$$/\1'$$((num + 1))'.0.-1/g' > tmp.$$$$; \
    cat tmp.$$$$ > $(DOXYGEN_CONFIG_FILE);              \
    rm tmp.$$$$