[+ autogen5 template -*- Scheme -*- am +]
[+ #|
 main.tpl - template used by autogen to generate main.am
 Copyright (C) 2015  Alex Vong

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software Foundation,
 Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.  |# +]

[+ "## main.am - automatically generated by autogen from main.def and main.tpl
## Copyright (C) 2015  Alex Vong
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; either version 2
## of the License, or (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software Foundation,
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA." +]

[+ INCLUDE "scheme.tpl" +]

[+ #| Source files to be distributed  |# +]
EXTRA_DIST = $(srcdir)/bootstrap \
[+ (string-append
    (source-name->path-name (get "normal_c"))
    (source-name->path-name (get "threads_c"))
    (source-name->path-name (get "tricky_c"))
    (source-name->path-name (get "header"))
    (patch-name->path-name (get "patch"))
    (script-name->path-name (get "script_doc")
			    (get "script_in")
			    (get "script_test"))
    (template-name->path-name (get "template"))
    (license-name->path-name (get "license"))) +]

[+ #| Documentation to be distributed  |# +]
nobase_dist_doc_DATA = [+ (html-name->path-name (get "share_html")) +]
dist_man_MANS = [+ (documentation-name->path-name (get "documentation")) +]

[+ #| What get cleaned by `$ make distclean'  |# +]
distclean-local: distclean-generic
	rmdir * 2> /dev/null || true

[+ #| What get cleaned by `$ make clean'  |# +]
CLEANFILES = mlucas.tmp mlucas.stamp mlucas TEST.tmp TEST.stamp \
[+ (get "script_test") +]

[+ #| Recipe of the test suit (one-liner script)  |# +]
TESTS = [+ (get "script_test") +]

[+ (generate-script-making-rule
    '()
    (script-name->path-name (get "script_test"))
    "TEST"
    (get "script_test")
    ""
    "true"
    "./") +]

[+ #| Globally used CPPFLAGS and CFLAGS  |# +]
[+ (if-use-threads
    (string-append
     "AM_CPPFLAGS="
     " $(ARCHCPPFLAGS)"
     " $(INSTRUCTIONCPPFLAGS)"
     " $(LFSCPPFLAGS)"
     " $(PATHCPPFLAGS)")
    " -DUSE_THREADS"
    "") +]
AM_CFLAGS = $(ARCHCFLAGS) $(INSTRUCTIONCFLAGS)

[+ #| Recipes to be included  |# +]
if AMD64_INSTRUCTION_UNSPECIFIED
[+ INCLUDE "amd64_instruction_unspecified.tpl" +]
else
[+ INCLUDE "generic.tpl" +]
endif
