From 5e4fb03b91c40fecb84b5b688c3f9d6a0551674e Mon Sep 17 00:00:00 2001 From: Christophe de Dinechin Date: Sat, 1 Jul 2017 12:48:08 +0200 Subject: [PATCH] Add example with libraries --- Makefile | 3 +++ lib1/Makefile | 26 ++++++++++++++++++++++++++ lib1/lib1.c | 4 ++++ lib2/Makefile | 27 +++++++++++++++++++++++++++ lib2/lib2.c | 4 ++++ 5 files changed, 64 insertions(+) create mode 100644 lib1/Makefile create mode 100644 lib1/lib1.c create mode 100644 lib2/Makefile create mode 100644 lib2/lib2.c diff --git a/Makefile b/Makefile index d050ed9..9ae6c5e 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,9 @@ BUILD=./ # Define the source code SOURCES=hello.cpp +# Define libraries we use in that project +LIBRARIES=lib1 lib2 + # Define the product of the build (.exe will be removed for Unix builds) PRODUCTS=hello.exe diff --git a/lib1/Makefile b/lib1/Makefile new file mode 100644 index 0000000..ee90f42 --- /dev/null +++ b/lib1/Makefile @@ -0,0 +1,26 @@ +#****************************************************************************** +# Makefile XL - An extensible language +#****************************************************************************** +# +# File Description: +# +# +# +# +# +# +# +# +# +# +#****************************************************************************** +# (C) 2017 Christophe de Dinechin +# This software is licensed under the GNU General Public License v3 +# See LICENSE file for details. +#****************************************************************************** + +BUILD=../ +SOURCES=lib1.c +PRODUCTS=lib1.lib + +include $(BUILD)rules.mk diff --git a/lib1/lib1.c b/lib1/lib1.c new file mode 100644 index 0000000..dab50ef --- /dev/null +++ b/lib1/lib1.c @@ -0,0 +1,4 @@ +int lib1_foo() +{ + return 0; +} diff --git a/lib2/Makefile b/lib2/Makefile new file mode 100644 index 0000000..8e09091 --- /dev/null +++ b/lib2/Makefile @@ -0,0 +1,27 @@ +#****************************************************************************** +# Makefile XL - An extensible language +#****************************************************************************** +# +# File Description: +# +# +# +# +# +# +# +# +# +# +#****************************************************************************** +# (C) 2017 Christophe de Dinechin +# This software is licensed under the GNU General Public License v3 +# See LICENSE file for details. +#****************************************************************************** + +BUILD=../ + +SOURCES=lib2.c +PRODUCTS=lib2.lib + +include $(BUILD)rules.mk diff --git a/lib2/lib2.c b/lib2/lib2.c new file mode 100644 index 0000000..970b465 --- /dev/null +++ b/lib2/lib2.c @@ -0,0 +1,4 @@ +int lib2_bar() +{ + return 0; +}