This commit is contained in:
intelligide 2015-07-03 16:57:33 +02:00
parent 7c5df6f7d0
commit e6b9622df2
6 changed files with 193 additions and 1 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 2.6)
project(g1m-assembler)
project(g1m_assembler)
if(NOT INSTALL_RUNTIME_DIR)
set(INSTALL_RUNTIME_DIR bin)
@ -14,12 +14,18 @@ endif()
if(NOT INSTALL_MAN_DIR)
set(INSTALL_MAN_DIR /man)
endif()
if(NOT INSTALL_CLIB_DIR)
set(INSTALL_CLIB_DIR clib)
endif()
add_subdirectory(man)
add_subdirectory(src)
add_subdirectory(doc)
install(DIRECTORY share/g1m-assembler/ DESTINATION "${INSTALL_DATA_DIR}")
install(DIRECTORY clib/ DESTINATION "${INSTALL_CLIB_DIR}")
install(FILES
"LICENSE"
"NOTICE"

58
doc/CMakeLists.txt Normal file
View File

@ -0,0 +1,58 @@
project(G1M-AssemblerDoc NONE)
option(SPHINX_MAN "Build man pages with Sphinx" OFF)
option(SPHINX_HTML "Build html pages with Sphinx" OFF)
find_program(SPHINX_EXECUTABLE
NAMES sphinx-build
DOC "Sphinx Documentation Builder (sphinx-doc.org)"
)
if(NOT SPHINX_MAN AND NOT SPHINX_HTML)
return()
elseif(NOT SPHINX_EXECUTABLE)
message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!")
endif()
set(conf_path "${CMAKE_CURRENT_SOURCE_DIR}")
configure_file(conf.py.in conf.py @ONLY)
set(doc_formats "")
if(SPHINX_HTML)
list(APPEND doc_formats html)
endif()
if(SPHINX_MAN)
list(APPEND doc_formats man)
endif()
set(doc_format_outputs "")
set(doc_format_last "")
foreach(format ${doc_formats})
set(doc_format_output "doc_format_${format}")
set(doc_format_log "build-${format}.log")
add_custom_command(
OUTPUT ${doc_format_output}
COMMAND ${SPHINX_EXECUTABLE}
-c ${CMAKE_CURRENT_BINARY_DIR}
-d ${CMAKE_CURRENT_BINARY_DIR}/doctrees
-b ${format}
${g1m_assembler_SOURCE_DIR}/doc/
${CMAKE_CURRENT_BINARY_DIR}/${format}
> ${doc_format_log} # log stdout, pass stderr
DEPENDS ${doc_format_last}
COMMENT "sphinx-build ${format}: see doc/${doc_format_log}"
VERBATIM
)
set_property(SOURCE ${doc_format_output} PROPERTY SYMBOLIC 1)
list(APPEND doc_format_outputs ${doc_format_output})
set(doc_format_last ${doc_format_output})
endforeach()
add_custom_target(documentation ALL DEPENDS ${doc_format_outputs})
if(SPHINX_HTML)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
DESTINATION ${INSTALL_DOC_DIR}
PATTERN .buildinfo EXCLUDE
PATTERN objects.inv EXCLUDE
)
endif()

74
doc/conf.py.in Normal file
View File

@ -0,0 +1,74 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import shlex
sys.path.insert(0, r'@conf_path@')
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.pngmath',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'g1m-assembler'
copyright = '2015, intelligide'
author = 'intelligide'
version = '1.0.0'
release = '1.0.0'
language = None
exclude_patterns = []
pygments_style = 'sphinx'
todo_include_todos = True
# -- Options for HTML output ----------------------------------------------
html_theme = 'sphinx_rtd_theme'
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
html_title = 'G1M Assembler %s Documentation' % release
html_short_title = '%s Documentation' % release
#html_logo = None
#html_favicon = None
html_static_path = ['_static']
#html_extra_path = []
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
html_show_sphinx = False
html_show_copyright = True
#html_search_language = 'en'
#html_search_scorer = 'scorer.js'
# Output file base name for HTML help builder.
htmlhelp_basename = 'g1m-assembler'

10
doc/index.rst Normal file
View File

@ -0,0 +1,10 @@
Welcome to G1M Assembler's documentation!
=============================================
Contents:
.. toctree::
:maxdepth: 2
manual/binaries

9
doc/manual/binaries.rst Normal file
View File

@ -0,0 +1,9 @@
Binaries
=============================================
Contents:
.. toctree::
:maxdepth: 2
binaries/mkg1m

View File

@ -0,0 +1,35 @@
mkg1m
*****
Synopsis
========
::
mkg1m input [-o output][-Ldir][-l cLib]
Description
===========
Convert text file to Casio G1M File
Options
=======
``-o input``
Write output to file. You must use -o
to specify the output file.
``-llibrary``
``-l library``
Search the library named library.
``-Ldir``
``-L dir``
add all the libraries in the folder *dir*.
``-h``
Print usage information.
``-v``
Print version information.