diff options
Diffstat (limited to 'examples/hello_TARGETS')
-rw-r--r-- | examples/hello_TARGETS/Makefile | 15 | ||||
-rw-r--r-- | examples/hello_TARGETS/Makefile.inc | 10 | ||||
-rw-r--r-- | examples/hello_TARGETS/expect.out | 67 | ||||
-rw-r--r-- | examples/hello_TARGETS/hello1/Makefile | 15 | ||||
-rw-r--r-- | examples/hello_TARGETS/hello1/hello1.c | 8 | ||||
-rw-r--r-- | examples/hello_TARGETS/hello1/hello1.pod | 17 | ||||
-rw-r--r-- | examples/hello_TARGETS/hello2/Makefile | 10 | ||||
-rw-r--r-- | examples/hello_TARGETS/hello2/hello2.c | 8 | ||||
-rw-r--r-- | examples/hello_TARGETS/hello2/hello2.pod | 22 | ||||
-rw-r--r-- | examples/hello_TARGETS/test.mk | 32 |
10 files changed, 204 insertions, 0 deletions
diff --git a/examples/hello_TARGETS/Makefile b/examples/hello_TARGETS/Makefile new file mode 100644 index 0000000..95fcf15 --- /dev/null +++ b/examples/hello_TARGETS/Makefile @@ -0,0 +1,15 @@ +SUBDIR = hello1 hello2 + +# additional recursive target +TARGETS += codingstylechk + +# We want to include man pages to the distribution tarball. +# For this we do the following: +# mkcmake manpages; tar -cf /tmp/tarball.tar . +TARGETS += _manpages # _manpages is a new recursive target +.PHONY: manpages +manpages: _manpages + @rm ${MKC_CACHEDIR}/_mkc* + +.include "test.mk" +.include <mkc.subdir.mk> diff --git a/examples/hello_TARGETS/Makefile.inc b/examples/hello_TARGETS/Makefile.inc new file mode 100644 index 0000000..b3f20f7 --- /dev/null +++ b/examples/hello_TARGETS/Makefile.inc @@ -0,0 +1,10 @@ +CSCHK = test hello1 = '${.CURDIR:T}' # something useful should be here + +.if make(codingstylechk) +MKCHECKS = no +.endif + +.PHONY: codingstylechk +codingstylechk: + @${_MESSAGE_V} "Coding style check for ${PROJECTNAME}"; \ + ${CSCHK} || { echo FAILED 1>&2; false; } diff --git a/examples/hello_TARGETS/expect.out b/examples/hello_TARGETS/expect.out new file mode 100644 index 0000000..e88091d --- /dev/null +++ b/examples/hello_TARGETS/expect.out @@ -0,0 +1,67 @@ +Hello World 1! +Hello World 2! +=========== all ============ +/objdir/Makefile +/objdir/Makefile.inc +/objdir/_mkc_compiler_type.err +/objdir/_mkc_compiler_type.res +/objdir/_mkc_prog_cc.err +/objdir/_mkc_prog_cc.res +/objdir/expect.out +/objdir/hello1/Makefile +/objdir/hello1/hello1 +/objdir/hello1/hello1.1 +/objdir/hello1/hello1.c +/objdir/hello1/hello1.o +/objdir/hello1/hello1.pod +/objdir/hello2/Makefile +/objdir/hello2/hello2 +/objdir/hello2/hello2.1 +/objdir/hello2/hello2.c +/objdir/hello2/hello2.o +/objdir/hello2/hello2.pod +/objdir/hello_TARGETS.test.out.tmp +/objdir/test.mk +========= codingstylechk ========== +================================================== +codingstylechk ===> hello_TARGETS/hello1 +Coding style check for hello1 +================================================== +codingstylechk ===> hello_TARGETS/hello2 +Coding style check for hello2 +FAILED +*** Error code 1 + +Stop. +bmake: stopped in /objdir/hello2 +*** Error code 1 + +Stop. +bmake: stopped in /objdir +cschk ex=1 +============= files =============== +/objdir/Makefile +/objdir/Makefile.inc +/objdir/expect.out +/objdir/hello1/Makefile +/objdir/hello1/hello1.c +/objdir/hello1/hello1.pod +/objdir/hello2/Makefile +/objdir/hello2/hello2.c +/objdir/hello2/hello2.pod +/objdir/hello_TARGETS.test.out.tmp +/objdir/test.mk +=========== manpages ============ +/objdir/Makefile +/objdir/Makefile.inc +/objdir/expect.out +/objdir/hello1/Makefile +/objdir/hello1/hello1.1 +/objdir/hello1/hello1.c +/objdir/hello1/hello1.pod +/objdir/hello2/Makefile +/objdir/hello2/hello2.1 +/objdir/hello2/hello2.c +/objdir/hello2/hello2.pod +/objdir/hello_TARGETS.test.out.tmp +/objdir/test.mk diff --git a/examples/hello_TARGETS/hello1/Makefile b/examples/hello_TARGETS/hello1/Makefile new file mode 100644 index 0000000..d1e6601 --- /dev/null +++ b/examples/hello_TARGETS/hello1/Makefile @@ -0,0 +1,15 @@ +PROG = hello1 +MAN = hello1.1 + +WARNS = 4 + +CLEANFILES = hello1.1 + +_manpages: ${MAN} + +# the following is just a regression test for exporting TARGETS +.if empty(TARGETS:Mcoding*) +MKC_ERR_MSG = "qqq" +.endif + +.include <mkc.mk> diff --git a/examples/hello_TARGETS/hello1/hello1.c b/examples/hello_TARGETS/hello1/hello1.c new file mode 100644 index 0000000..026f7e0 --- /dev/null +++ b/examples/hello_TARGETS/hello1/hello1.c @@ -0,0 +1,8 @@ +#include <stdio.h> +#include <stdlib.h> + +int main (int argc, char **argv ) +{ + puts ("Hello World 1!"); + exit (0); +} diff --git a/examples/hello_TARGETS/hello1/hello1.pod b/examples/hello_TARGETS/hello1/hello1.pod new file mode 100644 index 0000000..92581bb --- /dev/null +++ b/examples/hello_TARGETS/hello1/hello1.pod @@ -0,0 +1,17 @@ +=head1 NAME + +hello1 - mk-configure example program + +=head1 INTRODCTION + +lalala + +=head1 STEP1 + +bla bla bla + +=head1 STEP2 + +bla bla bla + +=head1 BYE diff --git a/examples/hello_TARGETS/hello2/Makefile b/examples/hello_TARGETS/hello2/Makefile new file mode 100644 index 0000000..20ada21 --- /dev/null +++ b/examples/hello_TARGETS/hello2/Makefile @@ -0,0 +1,10 @@ +PROG = hello2 +MAN = hello2.1 + +WARNS = 4 + +CLEANFILES = hello2.1 + +_manpages: ${MAN} + +.include <mkc.mk> diff --git a/examples/hello_TARGETS/hello2/hello2.c b/examples/hello_TARGETS/hello2/hello2.c new file mode 100644 index 0000000..95331f9 --- /dev/null +++ b/examples/hello_TARGETS/hello2/hello2.c @@ -0,0 +1,8 @@ +#include <stdio.h> +#include <stdlib.h> + +int main (int argc, char **argv ) +{ + puts ("Hello World 2!"); + exit (0); +} diff --git a/examples/hello_TARGETS/hello2/hello2.pod b/examples/hello_TARGETS/hello2/hello2.pod new file mode 100644 index 0000000..4479946 --- /dev/null +++ b/examples/hello_TARGETS/hello2/hello2.pod @@ -0,0 +1,22 @@ +=head1 NAME + +hello2 - mk-configure example + +=head1 SYNOPSIS + +B<hello2> I<[options]> I<[files...]> + +=head1 DESCRIPTION + +bla bla bla + +=head1 AUTHOR + +Copyright (c) 2010 Aleksey Cheusov <vle@gmx.net> + +=head1 HOME + +L<http://sourceforge.net/projects/mk-configure> + +=head1 SEE ALSO +L<mk-configure(7)> diff --git a/examples/hello_TARGETS/test.mk b/examples/hello_TARGETS/test.mk new file mode 100644 index 0000000..6949660 --- /dev/null +++ b/examples/hello_TARGETS/test.mk @@ -0,0 +1,32 @@ +# I added "codingstylechk" to "test" just for mk-configure regr. test + +test: +.PHONY : test_output +test_output : + @:; \ + ${OBJDIR_hello1}/hello1; \ + ${OBJDIR_hello2}/hello2; \ + MKCATPAGES=yes; export MKCATPAGES; \ + \ + echo =========== all ============; \ + find ${.OBJDIR} -type f -o -type l | \ + mkc_test_helper "${PREFIX}" "${.OBJDIR}"; \ + \ + echo ========= codingstylechk ==========; \ + ${MAKE} ${MAKEFLAGS} cleandir 2>/dev/null 1>&2; \ + { ${MAKE} ${MAKEFLAGS} codingstylechk 2>&1; echo cschk ex=$$?; } | \ + env NOSORT=1 mkc_test_helper "${PREFIX}" "${.OBJDIR}"; \ + \ + echo ============= files ===============; \ + find ${.OBJDIR} -type f -o -type l | \ + mkc_test_helper "${PREFIX}" "${.OBJDIR}"; \ + \ + echo =========== manpages ============; \ + env MKCATPAGES=no ${MAKE} ${MAKEFLAGS} cleandir 2>/dev/null 1>&2; \ + ${MAKE} ${MAKEFLAGS} manpages 2>/dev/null 1>&2; \ + find ${.OBJDIR} -type f | \ + mkc_test_helper "${PREFIX}" "${.OBJDIR}" + \ + ${MAKE} ${MAKEFLAGS} cleandir 2>/dev/null 1>&2 + +.include <mkc.minitest.mk> |