Operating System Programming 4DISS

(REV358--31-Jan-2024)
Welcome to the Operating System Programming for DISS site. The following is a step-by-step guide to set up a Virtual Debian Guest on VirtualBox. This site has been managed by VauLSMorg since 2020.
This is the WAY!

View on GitHub

HOME ABOUT WEB GITHUB TOP BOTTOM PREV NEXT

autoconf example: A Small Hello World


// START Mon 28 Feb 2022 22:30:00 WIB
// Copyright (c) Free Software Foundation, Inc.
// Verbatim copying and distribution of this entire article is permitted in any medium, 
// provided this notice is preserved.
// URL: https://www.gnu.org/savannah-checkouts/gnu/automake/manual/html_node/Hello-World.html


Create File: “README”

This is a demonstration package for GNU Automake.
Type 'info Automake' to read the Automake manual.


Create File: “Makefile.am”

SUBDIRS = src
dist_doc_DATA = README


Create File: “configure.ac”

AC_INIT([amhello], [1.0], [bug-automake@gnu.org])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
   Makefile
   src/Makefile
])
AC_OUTPUT


Create File: “src/Makefile.am”

bin_PROGRAMS = hello
hello_SOURCES = main.c


Create File: “src/main.c”

#include <config.h>
#include <stdio.h>
//  ***  CHANGE THIS! **************
#define  MYNAME "Your-GitHub-Account"

int
main (void)
{
  puts ("Hello World!");
  puts ("I am " MYNAME ".");
  puts ("This is " PACKAGE_STRING ".");
  return 0;
}


RUN

autoreconf --install

./configure

make

src/hello

make distcheck

make clean



HOME ABOUT WEB GITHUB TOP BOTTOM PREV NEXT