-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
105 lines (84 loc) · 3.6 KB
/
Makefile
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# ------------------------------------------------------------------------------
# Makefile for GitHub project cmpi-wg/cmpi-headers
#
# Supported platforms for this makefile:
# Linux
# Not tested on Windows, may work when using CygWin
#
# Prerequisites:
# make (GNU make)
# doxygen 1.8.2 or higher
# sh, echo, cd, test, rm, mkdir
# zip, unzip
#
# It is assumed that the GitHub project cmpi-wg/cmpi-wg.github.io has its work
# directory in the location specified by the github_pages_work_dir variable.
# ------------------------------------------------------------------------------
# Current CMPI version in m.n.u format.
# Keep in sync with the CMPI header files
cmpi_version := 2.1.0
# Work directory of corresponding GitHub pages project
github_pages_work_dir := ../cmpi-wg.github.io.git
# Unpack location for Doxygen HTML ZIP file within GitHub pages project
github_pages_unpack_dir := $(github_pages_work_dir)/cmpi-releases/$(cmpi_version)
# Doxygen HTML output directory in this project.
# Keep in sync with HTML_OUTPUT parameter in Doxyfile
doxygen_html_out_dir := doxygen/html
doxygen_html_out_updir := ../..
# Doxygen extra CSS stylesheet file.
# Keep in sync with HTML_EXTRA_STYLESHEET parameter in Doxyfile
doxygen_css_file := resources/doxygen_cmpi.css
# Doxygen mainpage file.
# Keep in sync with USE_MDFILE_AS_MAINPAGE parameter in Doxyfile
doxygen_mainpage_file := mainpage.md
# Doxygen command and any options
doxygen_cmd := doxygen
# Generated CMPI API ZIP file with Doxygen HTML output
cmpi_api_html_zip_file := files/cmpi_$(cmpi_version)_api_html.zip
# Generated CMPI headers ZIP file
cmpi_headers_zip_file := files/cmpi_$(cmpi_version)_headers.zip
# CMPI header files
cmpi_headers := cmpift.h cmpidt.h cmpios.h cmpipl.h cmpimacs.h
# No built-in rules needed
.SUFFIXES:
.PHONY: build publish clean all help
build_files := $(cmpi_headers_zip_file) $(cmpi_api_html_zip_file)
build: $(build_files)
@echo 'Makefile: $@ done; created: $(build_files)'
publish: $(github_pages_unpack_dir) build
test -d $(github_pages_unpack_dir)/api
test -d $(github_pages_unpack_dir)/files
sh -c 'cd $(github_pages_unpack_dir)/api; rm -rf *'
unzip -qo -d $(github_pages_unpack_dir)/api $(cmpi_api_html_zip_file)
cp -p $(cmpi_api_html_zip_file) $(github_pages_unpack_dir)/files/
cp -p $(cmpi_headers_zip_file) $(github_pages_unpack_dir)/files/
@echo 'Makefile: $@ done; published to: $(github_pages_unpack_dir)'
clean:
rm -rf doxygen
@echo 'Makefile: $@ done.'
clobber: clean
rm -f $(build_files)
@echo 'Makefile: $@ done.'
all: build publish clean
@echo 'Makefile: $@ done.'
help:
@echo 'Makefile for CMPI headers project'
@echo 'Valid targets are:'
@echo ' build - (default) Build the API and header zip files.'
@echo ' publish - Publish the API and header zip files to CMPI pages project.'
@echo ' clean - Remove any temporary files.'
@echo ' clobber - Remove any temporary files and build products.'
@echo ' all - build, publish, clean'
# CMPI API ZIP file with Doxygen HTML output
# Because it is hard to capture all generated HTML files, they are considered
# an intermediate product (= temporary files) and the zip file picking them up
# is considered the build product.
$(cmpi_api_html_zip_file): $(cmpi_headers) Doxyfile resources/*.png $(doxygen_css_file) \
$(doxygen_mainpage_file) modules.dox
mkdir -p $(doxygen_html_out_dir)
sh -c 'cd $(doxygen_html_out_dir); rm -rf *'
$(doxygen_cmd)
sh -c 'cd $(doxygen_html_out_dir); zip -qru $(doxygen_html_out_updir)/$(cmpi_api_html_zip_file) .'
# CMPI headers ZIP file.
$(cmpi_headers_zip_file): $(cmpi_headers)
zip -quo $(cmpi_headers_zip_file) $(cmpi_headers)