File: README.md

package info (click to toggle)
mk-configure 0.36.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,996 kB
  • sloc: ansic: 4,974; makefile: 1,387; sh: 1,087; cpp: 177; perl: 101; yacc: 85; lex: 21
file content (265 lines) | stat: -rw-r--r-- 9,961 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
[toc]

Installation
------------

See [doc/INSTALL.md](https://github.com/cheusov/mk-configure/blob/master/doc/INSTALL.md)
file for build and installation instructions.

What is mk-configure?
---------------------

**mk-configure** is a lightweight replacement for *GNU autotools*,
written in and for bmake (portable version of **NetBSD** make) and
**UNIX** tools (_shell_, _awk_ etc.).  **FreeBSD** and **OpenBSD** make
are not good. They are incompatible with _NetBSD bmake_. _GNU
make_ is not good too.

**mk-configure** provides a number of include files (.mk files) written in
bmake and a number of standalone programs that should be installed to
user's host for building a software.

**mk-configure** features:

 - An easy way for building standalone executables, static and shared
   libraries written in _C_, _C++_ and _Objective
   C_; _.cat_ and _.html_ files from man pages; _.info_ pages from _texinfo_
   sources etc. _LEX_, _YACC_ are also supported. Support for other
   languages are planned.

 - Installing and uninstalling executables, libraries, scripts,
   documentation files and others. DESTDIR support is also provided.

 - Integrated autoconf-like support for finding #include files,
   libraries and function implementation, function definitions,
   defines, types, struct members etc.

 - A number of built-in checks for, e.g., system endianness, _GNU bison_
   or _GNU flex_ programs and many others.

 - Automatic dependency analysis built-in for C and C++.

 - Extensibility by writing bmake include files.

 - Support for regression tests (see *mkc.minitest.mk* for the sample).

 - mk-configure is small and easy. It is definitely much easier for
   use than _GNU autotools_, many people think that it is also easier
   than other competing projects like _CMake_, _scons_ and others.

Project goals
-------------

 - No code generation! Library approach is used instead.  Instead of
   generating tons of unreadable blobs **mk-configure** uses bmake include
   files (bmake's library) and external executables to make its job.
   Developers should distribute source code only, not blobs.

 - Single top level command for building a program (**mkcmake**).
   Instead of running and learning
   autoconf/automake/aclocal/autoreconf/config.status/autoheader and
   many other tools, and the way they interact with each other, you
   should learn only ONE tool, bmake (**mkcmake** is a trivial wrapper
   over bmake).

 - No bloat. At this time **mk-configure** consists of far less than 10000
   lines of code (excluding examples and regression tests). Compare
   this number with autotools sources and you'll see a difference.

 - Simplicity for both developers and users. The only file developers
   should be aware of during development is 'Makefile'.  Users just
   run

        $ mkcmake help
        $ env <variables> mkcmake all <options>

   to build a software. The
   same for developers -- for building a software, just run **mkcmake**.

 - Portability. At the moment the following systems and compilers are
   supported:

    - **NetBSD**. Tested on NetBSD-5.0/x86 and NetBSD-2.0/alpha and later
      versions with gcc, pcc and clang.

    - **FreeBSD**. Tested on FreeBSD-6.2/x86, 7.1/spark64, 7.1/x86 and
      later versions with gcc and clang.

    - **OpenBSD**. Tested on OpenBSD-3.8/x86, 4.5/x86 and later versions
      with gcc.

    - **DragonFlyBSD**. Tested on DragonFly-2.4.1-RELEASE/x86 and later
      versions with gcc.

    - **MirOS BSD**. Tested on MirBSD-10/x86 and later versions with gcc.

    - **Linux**. Tested on Linux/{x86,x86-64,ppc,armv7,aarch64} with glibc/musl, gcc,
      icc and SunStudio compilers.

    - **Solaris**. Tested on Solaris-{10,11}/{spark64,x86}
      with SunC-5.11, SunC-5.15 and gcc.

    - **Darwin** (macOS). Tested on Darwin-8.11.0/ppc (MacOS-X Tiger)
      and later version with native gcc and clang.

    - **Interix**. Tested on Interix-3.5/x86 with gcc.

    - **QNX**. Tested on QNX-6.3/x86 with gcc.

    - **OSF1**. Tested on Tru64-5.1/alpha with gcc and DEC C compiler.

    - **HP-UX**. Tested on HP-UX-11.0/hppa with gcc.

    - Partial support for **AIX** and their native
      compilers. Support is not complete because I have no access to
      "big iron" :-( .

    If you don't see your favorite system/compiler here and want to
    help me to improve **mk-configure**, feel free to contact me.

 - Declarative approach in writing Makefiles. Instead of specifying
   how to build your software, you should specify source files,
   files to build and (optionally) build options, e.g. LDCOMPILER=yes
   meaning that ${CC} or ${CXX} compiler should be used as a linker
   instead of ${LD}. Small/medium size projects may have no rules in
   Makefiles at all. Most useful things are already implemented in
   **mk-configure** Mk files including targets
   "all", "install", "uninstall" as well as support for building the shared
   libraries, installation to ${DESTDIR} etc. Usually, Makefile contain
   only variable assignments, .include-s and .if/.for directives.

 - No heavy dependencies like Python or Perl.

How to use mk-configure?
------------------------

Developers:
 - Install **mk-configure** to your system.
 - Run **mkcmake** or **mkcmake all** for building your program.
   You don't need autoconf/autoheader/automake/aclocal/config.guess/
   /autoreconf/config.status/config.sub and blah-blah-blah

Users and software packagers:
 - Install **mk-configure** to your system.
 - Run **mkcmake** for building a software and pass to it
   the building options, e.g.

        $ export CC=pcc
        $ export CFLAGS='-O0 -g'
        $ export PREFIX=$HOME/local
        $ mkcmake all install

What mk-configure consists of?
------------------------------

- *mkc.{files,lib,prog,subprj,subdir}.mk* files.

    These include files are responsible for building, installing and
    uninstalling applications, static and shared libraries, scripts,
    text files, man and info pages, hard and soft links etc...

    NOTE FOR *BSD USERS: unlike well known Mk files from \*BSD
    systems *mkc.\*.mk* files provide the following features (this list
    is not complete, see *mk-configure.7* for details).

    + PREFIX, BINDIR, MANDIR etc. variables default to directories
    under /usr/local.  By default the same variables in *bsd.\*.mk*
    files are set to directories under /usr. The reason is that they
    are used mainly for maintaining \*BSD's own code
    while **mk-configure** is targeted to all UNIX-like systems, not only \*BSD.

    + BINOWN, BINGRP, MANOWN etc. variables are set to 'id -u' and
    'id -g' if **mkcmake(1)** is run under an unprivileged user.
    By default *bsd.\*.mk* use root:wheel by default.

    + A target 'install' installs the target directories if needed.

    + A target 'uninstall' removes all installed files from
    destination directories. *bsd.\*.mk* files do not provide
    this functionality.

    + A target 'test' of *mkc.subdir.mk* (by default) runs a "test"
    target for each subdirectory listed in SUBDIR. Other *mkc.\*.mk*
    files provide "test" target too but does nothing by default.
    If you want to test your application, define your own "test"
    target in subprojects's Makefile.

    + "cleandir" target removes all temporary
    files and **mk-configure**'s cache files.

    + support for texinfo/info files. There is no need to .include
        a special include files such as _bsd.info.mk_ file.

    + *mkc.subprj.mk* is a powerful replacement
        for traditional _bsd.subdir.mk_.

    + Tons of other additions and improvements.

- _mkc.intexts.mk_. Given a list of files in INFILES or INSCRIPTS *mkc.intexts.mk*
  generates them from appropriate *.in file replacing @prefix@,
  @sysconfdir@, @libdir@, @bindir@, @sbindir@, @datadir@ etc. with
  real ${PREFIX}, ${SYSCONFDIR} etc. See examples/ subdirectory for
  the samples.

- *mkc.configure.mk*. It is a replacement for _GNU autoconf_. Its
  functionality is large enough to describe here.  In short, it allows
  to check for presence of header files, function or variable
  declarations, presence of function in a particular library, defines,
  sizeof of data types and other useful things. Read the documentation
  in *mk-configure.7* and see examples/ subdirectory for the samples of
  use.

- Standalone full-functional
  **mkc\_check\_{funclib,header,sizeof,decl,prog,custom,compiler}** and
  other programs that can be used without **mkcmake** and without _mkc.*.mk_
  files.  Read appropriate man pages.

- This list is not complete. Have a look at *mk-configure.7* for details.

Documentation
-------------

   - Subdirectory presentation/ contains a PDF file which demonstrates
     some basic ideas and samples of use.

   - In subdirectory examples/ you may find a lot of examples.

   - Documentation for mk include files is in *mk-configure.7*).

   - [doc/NOTES](https://github.com/cheusov/mk-configure/blob/master/doc/NOTES)
   contains a number of useful recipes.

   - Read the [doc/FAQ](https://github.com/cheusov/mk-configure/blob/master/doc/FAQ)
   document. It may be helpful.

   - Most of my [personal projects](https://github.com/cheusov) use **mk-configure**.
     You can use them for learning.

   - Plans are here [doc/TODO](https://github.com/cheusov/mk-configure/blob/master/doc/TODO).

mk-configure binary packages
----------------------------

Binary packages for **mk-configure** are available in the following systems (this list may be incomplete):

 * NetBSD pkgsrc (devel/mk-configure).
 
 * FreeBSD ports (devel/mk-configure)
 
 * Debian/Ubuntu Linux
 
 * AltLinux
 
 * Arch Linux
 
 * OpenSuSE Linux

Feedback
--------

Please register bug reports and pull requests here
[mk-configure home](http://github.com/cheusov/mk-configure)

Feel free to notify me about spelling errors in the documentation.

-------------------------------------------------------------------------