From 330d4db959430492c159a931c8e6d272fc118921 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 16 May 2017 03:46:37 +0200 Subject: [PATCH] Use autotools as build system Change the build system from simple Makefile to autotools. This will provide the missing install and uninstall targets. Furthermore passing CPPFLAGS will be supported. Signed-off-by: Heinrich Schuchardt --- AUTHORS | 1 + ChangeLog | 4 ++++ Makefile | 21 --------------------- Makefile.am | 3 +++ NEWS | 1 + README | 1 + autogen.sh | 12 ++++++++++++ configure.ac | 26 ++++++++++++++++++++++++++ src/Makefile.am | 5 +++++ aml.h => src/aml.h | 0 amlbootsig.c => src/amlbootsig.c | 0 amlinfo.c => src/amlinfo.c | 0 fip.h => src/fip.h | 0 meson.h => src/meson.h | 0 unamlbootsig.c => src/unamlbootsig.c | 0 15 files changed, 53 insertions(+), 21 deletions(-) create mode 100644 AUTHORS create mode 100644 ChangeLog delete mode 100644 Makefile create mode 100644 Makefile.am create mode 120000 NEWS create mode 120000 README create mode 100755 autogen.sh create mode 100644 configure.ac create mode 100644 src/Makefile.am rename aml.h => src/aml.h (100%) rename amlbootsig.c => src/amlbootsig.c (100%) rename amlinfo.c => src/amlinfo.c (100%) rename fip.h => src/fip.h (100%) rename meson.h => src/meson.h (100%) rename unamlbootsig.c => src/unamlbootsig.c (100%) diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..cb864dc --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Andreas Färber diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..994bee7 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,4 @@ +Version 0.2, 2017-xx-yy + Use autotools as build system +Version 0.1, 2017-05-01 + Initial release diff --git a/Makefile b/Makefile deleted file mode 100644 index 260c596..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -all: amlbootsig unamlbootsig amlinfo - -CFLAGS = -g -LDFLAGS = -lcrypto - -amlbootsig.o unamlbootsig.o amlinfo.o: meson.h fip.h - -%.o: %.c - $(CC) $(CFLAGS) -o $@ -c $< - -amlbootsig: amlbootsig.o - $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) - -unamlbootsig: unamlbootsig.o - $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) - -amlinfo: amlinfo.o - $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) - -clean: - -rm -f amlbootsig unamlbootsig amlinfo test *.o diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..26226b0 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = src + +ACLOCAL_AMFLAGS = -I m4 diff --git a/NEWS b/NEWS new file mode 120000 index 0000000..b0936e8 --- /dev/null +++ b/NEWS @@ -0,0 +1 @@ +ChangeLog \ No newline at end of file diff --git a/README b/README new file mode 120000 index 0000000..42061c0 --- /dev/null +++ b/README @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..b79afb6 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +test -f configure.ac || { + echo "Please, run this script in the top level project directory." + exit +} + +libtoolize --force --copy +aclocal -I m4 +autoconf +automake --add-missing --copy + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..082dd29 --- /dev/null +++ b/configure.ac @@ -0,0 +1,26 @@ +dnl meson-tools + +dnl Initialization +AC_INIT([meson-tools], [0.2], [Andreas Färber ]) +AM_INIT_AUTOMAKE +LT_INIT + +dnl Configure macros +AC_CONFIG_MACRO_DIR([m4]) + +LDFLAGS+=" -lcrypto" + +AC_CHECK_HEADER([openssl/sha.h], + [], + [AC_MSG_ERROR([openssl/sha.h not found. Please, install libssl-dev.])] + ) + +dnl Makefiles +AC_CONFIG_FILES([ + Makefile + src/Makefile + ]) + +dnl Generate files +AC_OUTPUT + diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..92ca600 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,5 @@ +bin_PROGRAMS = amlbootsig unamlbootsig amlinfo + +amlbootsig_SOURCES = amlbootsig.c aml.h fip.h meson.h +unamlbootsig_SOURCES = unamlbootsig.c aml.h fip.h meson.h +amlinfo_SOURCES = amlinfo.c aml.h fip.h meson.h diff --git a/aml.h b/src/aml.h similarity index 100% rename from aml.h rename to src/aml.h diff --git a/amlbootsig.c b/src/amlbootsig.c similarity index 100% rename from amlbootsig.c rename to src/amlbootsig.c diff --git a/amlinfo.c b/src/amlinfo.c similarity index 100% rename from amlinfo.c rename to src/amlinfo.c diff --git a/fip.h b/src/fip.h similarity index 100% rename from fip.h rename to src/fip.h diff --git a/meson.h b/src/meson.h similarity index 100% rename from meson.h rename to src/meson.h diff --git a/unamlbootsig.c b/src/unamlbootsig.c similarity index 100% rename from unamlbootsig.c rename to src/unamlbootsig.c