inweb-bootstrap: Add the GNU Build System.

* configure.ac: Add it.
* Makefile.am: Add it.
This commit is contained in:
AwesomeAdam54321 2024-03-10 00:34:20 +08:00
parent d167c16357
commit 8e12e9c701
2 changed files with 157 additions and 0 deletions

108
Makefile.am Normal file
View file

@ -0,0 +1,108 @@
AUTOMAKE_OPTIONS = foreign subdir-objects
.nw.cc:
$(NOTANGLE) -L $< | $(CPIF) $@
.nw.tex:
$(NOWEAVE) $< | $(CPIF) $@
.tex.pdf:
$(PDFLATEX) $< | $(CPIF) $@
.nw.html:
$(NOWEAVE) -html -filter l2h $< | $(CPIF) $@
bin_PROGRAMS = inweb
inweb_files = Preliminaries/How_This_Program_Works.nw \
Chapter_1/Assets_Plugins_and_Colour_Schemes.nw \
Chapter_1/Basics.nw \
Chapter_1/Configuration.nw \
Chapter_1/Patterns.nw \
Chapter_1/Program_Control.nw \
Chapter_1/The_Swarm.nw \
Chapter_2/Enumerated_Constants.nw \
Chapter_2/Line_Categories.nw \
Chapter_2/Paragraph_Macros.nw \
Chapter_2/Paragraph_Numbering.nw \
Chapter_2/Tags.nw \
Chapter_2/The_Parser.nw \
Chapter_2/The_Reader.nw \
Chapter_3/The_Analyser.nw \
Chapter_3/The_Collater.nw \
Chapter_3/The_Tangler.nw \
Chapter_3/The_Weaver.nw \
Chapter_3/The_Weaver_of_Text.nw \
Chapter_4/ACME_Support.nw \
Chapter_4/C-Like_Languages.nw \
Chapter_4/InC_Support.nw \
Chapter_4/Language_Methods.nw \
Chapter_4/Programming_Languages.nw \
Chapter_4/The_Painter.nw \
Chapter_4/Types_and_Functions.nw \
Chapter_5/Debugging_Format.nw \
Chapter_5/Format_Methods.nw \
Chapter_5/HTML_Formats.nw \
Chapter_5/Plain_Text_Format.nw \
Chapter_5/TeX_Format.nw \
Chapter_5/TeX_Utilities.nw \
Chapter_5/Weave_Tree.nw \
Chapter_6/Colonies.nw \
Chapter_6/Ctags_Support.nw \
Chapter_6/Git_Support.nw \
Chapter_6/Makefiles.nw \
Chapter_6/Readme_Writeme.nw
foundation = foundation-module/Preliminaries/A_Brief_Guide_to_Foundation.nw \
foundation-module/Chapter_1/Foundation_Module.nw \
foundation-module/Chapter_1/POSIX_Platforms.nw \
foundation-module/Chapter_2/Debugging_Log.nw \
foundation-module/Chapter_2/Dictionaries.nw \
foundation-module/Chapter_2/Foundation_Classes.nw \
foundation-module/Chapter_2/Linked_Lists_and_Stacks.nw \
foundation-module/Chapter_2/Locales.nw \
foundation-module/Chapter_2/Memory.nw \
foundation-module/Chapter_2/Methods.nw \
foundation-module/Chapter_2/Streams.nw \
foundation-module/Chapter_2/Trees.nw \
foundation-module/Chapter_2/Writers_and_Loggers.nw \
foundation-module/Chapter_3/Case-Insensitive_Filenames.nw \
foundation-module/Chapter_3/Command_Line_Arguments.nw \
foundation-module/Chapter_3/Directories.nw \
foundation-module/Chapter_3/Error_Messages.nw \
foundation-module/Chapter_3/Filenames.nw \
foundation-module/Chapter_3/Pathnames.nw \
foundation-module/Chapter_3/Shell.nw \
foundation-module/Chapter_3/Time.nw \
foundation-module/Chapter_4/Characters.nw \
foundation-module/Chapter_4/C_Strings.nw \
foundation-module/Chapter_4/JSON.nw \
foundation-module/Chapter_4/Pattern_Matching.nw \
foundation-module/Chapter_4/Preprocessor.nw \
foundation-module/Chapter_4/String_Manipulation.nw \
foundation-module/Chapter_4/Text_Files.nw \
foundation-module/Chapter_4/Tries_and_Avinues.nw \
foundation-module/Chapter_4/Wide_Strings.nw \
foundation-module/Chapter_5/Epub_Ebooks.nw \
foundation-module/Chapter_5/HTML.nw \
foundation-module/Chapter_6/Binary_Files.nw \
foundation-module/Chapter_6/Image_Dimensions.nw \
foundation-module/Chapter_6/Sound_Durations.nw \
foundation-module/Chapter_7/Version_Number_Ranges.nw \
foundation-module/Chapter_7/Version_Numbers.nw \
foundation-module/Chapter_8/Bibliographic_Data_for_Webs.nw \
foundation-module/Chapter_8/Build_Files.nw \
foundation-module/Chapter_8/Simple_Tangler.nw \
foundation-module/Chapter_8/Web_Modules.nw \
foundation-module/Chapter_8/Web_Structure.nw
foundation_test_files = foundation-test/Sections/Program_Control.nw \
foundation-test/Sections/Unit_Tests.nw
inweb_SOURCES = $(inweb_files:.nw=.cc)
html: $(inweb_files:.nw=.html) $(foundation:.nw:.html)
pdf: $(inweb_files:.nw=.pdf) $(foundation:.nw:.pdf)

49
configure.ac Normal file
View file

@ -0,0 +1,49 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([inweb-bootstrap], [7.2.0], [adam.faiz@disroot.org])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CXX
AC_CHECK_TOOL(NOWEAVE,noweave,no)
AS_IF([test "$NOWEAVE" = "no"], [AC_MSG_ERROR([Please install noweave before configuring.])])
AC_CHECK_TOOL(NOTANGLE,notangle,no)
AS_IF([test "$NOTANGLE" = "no"], [AC_MSG_ERROR([Please install notangle before configuring.])])
AC_CHECK_TOOL(PDFLATEX,pdflatex,no)
AS_IF([test "$PDFLATEX" = "no"], [AC_MSG_ERROR([Please install texlive-scheme-basic before configuring.])])
AC_CHECK_TOOL(CPIF,cpif,no)
AS_IF([test "$CPIF" = "no"], [AC_MSG_ERROR([Please install cpif before configuring.])])
AC_SUBST(NOWEAVE)
AC_SUBST(NOTANGLE)
AC_SUBST(PDFLATEX)
AC_SUBST(CPIF)
# Checks for libraries.
# Checks for header files.
#AC_CHECK_HEADERS([limits.h stdint.h stdlib.h string.h strings.h unistd.h wchar.h])
# Checks for typedefs, structures, and compiler characteristics.
#AC_TYPE_OFF_T
#AC_TYPE_PID_T
#AC_TYPE_SIZE_T
#AC_TYPE_SSIZE_T
#AC_TYPE_UINT32_T
#AC_TYPE_UINT64_T
# Checks for library functions.
#AC_FUNC_MALLOC
#AC_FUNC_MKTIME
#AC_CHECK_FUNCS([atexit memset mkdir realpath strcasecmp strerror])
AM_INIT_AUTOMAKE
AC_CONFIG_FILES([Makefile])
AC_OUTPUT