Pull request #217 » skeleton.patch
templates/skeleton/template.tcl | ||
---|---|---|
#
|
||
# Copyright (c) 2010-2015,2017 LAAS/CNRS
|
||
# Copyright (c) 2010-2019 LAAS/CNRS
|
||
# All rights reserved.
|
||
#
|
||
# Redistribution and use in source and binary forms, with or without
|
||
... | ... | |
# +-t+::
|
||
# +--terse+ ::
|
||
# Produce terse output: no documentation is generated
|
||
# +-d+::
|
||
# +--doc_only+ ::
|
||
# Just produce the README.adoc documentation
|
||
# +-h+::
|
||
# +--help+ ::
|
||
# Print usage summary (this text)
|
||
... | ... | |
# defaults: no file overwrite
|
||
engine mode -overwrite -merge-if-change
|
||
set terse no
|
||
set doc_only no
|
||
# parse options
|
||
template options {
|
||
... | ... | |
}
|
||
-f - --force { engine mode +overwrite }
|
||
-t - --terse { set terse yes }
|
||
-d - --doc_only { set doc_only yes }
|
||
-h - --help { puts [template usage]; exit 0 }
|
||
}
|
||
... | ... | |
set src [lang $iface; fileext]
|
||
set ext [lang $lang; fileext]
|
||
foreach c [dotgen components] {
|
||
# one source file for each task
|
||
foreach t [$c tasks] {
|
||
template parse \
|
||
args [list $c $t] file codels.codel$src \
|
||
file codels/[$c name]_[$t name]_codels$ext
|
||
}
|
||
# and one file for codels with no associated task
|
||
template parse \
|
||
args [list $c ""] file codels.codel$src \
|
||
file codels/[$c name]_codels$ext
|
||
# mandatory pkg-config file
|
||
template parse \
|
||
args [list $c] file component.pc.in \
|
||
file [$c name]-genom3.pc.in
|
||
template parse \
|
||
args [list $c] file component-uninstalled.pc.in \
|
||
file [$c name]-genom3-uninstalled.pc.in
|
||
}
|
||
if {!$doc_only} {
|
||
foreach c [dotgen components] {
|
||
# one source file for each task
|
||
foreach t [$c tasks] {
|
||
template parse \
|
||
args [list $c $t] file codels.codel$src \
|
||
file codels/[$c name]_[$t name]_codels$ext
|
||
}
|
||
# and one file for codels with no associated task
|
||
template parse \
|
||
args [list $c ""] file codels.codel$src \
|
||
file codels/[$c name]_codels$ext
|
||
# mandatory pkg-config file
|
||
template parse \
|
||
args [list $c] file component.pc.in \
|
||
file [$c name]-genom3.pc.in
|
||
template parse \
|
||
args [list $c] file component-uninstalled.pc.in \
|
||
file [$c name]-genom3-uninstalled.pc.in
|
||
}
|
||
}
|
||
# asciidoc template
|
||
if {!$terse} {
|
||
template parse args [list $input] \
|
||
file readme.adoc file README.adoc
|
||
if {!$terse || $doc_only} {
|
||
template parse args [list $input] \
|
||
file readme.adoc file README.adoc
|
||
}
|
||
# generate user build files fragment
|
||
#
|
||
template parse perm a+x \
|
||
string "#!/bin/sh\nautoreconf -vi\n" \
|
||
file bootstrap.sh
|
||
template parse \
|
||
file ag_templates.m4 file autoconf/ag_templates.m4
|
||
template parse \
|
||
args [list $input $lang $terse] \
|
||
file top.configure.ac file configure.ac
|
||
template parse \
|
||
args [list $input $idls $lang $terse] \
|
||
file top.Makefile.am file Makefile.am
|
||
template parse \
|
||
args [list $input $lang] file codels.Makefile.am \
|
||
file codels/Makefile.am
|
||
if {!$doc_only} {
|
||
template parse perm a+x \
|
||
string "#!/bin/sh\nautoreconf -vi\n" \
|
||
file bootstrap.sh
|
||
template parse \
|
||
file ag_templates.m4 file autoconf/ag_templates.m4
|
||
template parse \
|
||
args [list $input $lang $terse] \
|
||
file top.configure.ac file configure.ac
|
||
template parse \
|
||
args [list $input $idls $lang $terse] \
|
||
file top.Makefile.am file Makefile.am
|
||
template parse \
|
||
args [list $input $lang] file codels.Makefile.am \
|
||
file codels/Makefile.am
|
||
}
|