From 8aaaa41621f9ddc87e1f7b2e2c59ed095bba7304 Mon Sep 17 00:00:00 2001 From: Kyle K Date: Tue, 8 Aug 2017 15:01:16 -0500 Subject: GNU Build system helloworld example using autotools --- README | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 README (limited to 'README') diff --git a/README b/README new file mode 100644 index 0000000..2fb38f0 --- /dev/null +++ b/README @@ -0,0 +1,33 @@ +- hello world mini Autotools tutorial + there's mainly 2 parts: 1st is to write "configure.ac" and 2nd write Makefile.am + $ autoscan + $ mv configure.scan configure.ac + $ aclocal # Set up an m4 environment + $ autoconf # Generate configure from configure.ac + $ autoheader + $ touch NEWS README AUTHORS Changelog + $ automake --add-missing # Generate Makefile.in from Makefile.am + $ ./configure # Generate Makefile from Makefile.in + $ make distcheck # Use Makefile to build and test a tarball to distribute + $ make + $ make install + + configure.ac + AC_INIT([helloworld], [0.1], [kylek389@gmail.com]) + AM_INIT_AUTOMAKE + AC_PROG_CC + AC_CONFIG_FILES([Makefile]) + AC_OUTPUT + + Makefile.am + AUTOMAKE_OPTIONS = foreign + bin_PROGRAMS = helloworld + helloworld_SOURCES = helloworld.c + +- misc + config.h -- you can include "config.h" in your .c code and use constants defined in config.h to write portable code + ifnames. -- use this command to list what 'constants' have be used from config.h in *.c files of current project + 2 awesome tutorials: + -> https://robots.thoughtbot.com/the-magic-behind-configure-make-make-install + -> http://markuskimius.wikidot.com/programming:tut:autotools + -- cgit v1.2.3