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
|
NAME
MakeMake.pl -- Perl-based C/C++ makefile generator
SYNOPSIS
makemake.pl > makefile
makemake.pl make.conf > makefile
DESCRIPTION
input file is `mm.conf' or/and `make.make' or given file as 1st arg
output is printed to the stdout
usage: makemake.pl > makefile usage: makemake.pl mm.dos.conf > makefile
...
mm.conf/make.make format is:
---begin---
# comments begin with # or ;
; this is also comment
# defaults for all targets
CC = gcc
LD = gcc
AR = ar rv
RANLIB = ranlib
SRC = *.c *.cpp *.cc *.cxx
# default commands
MKDIR = mkdir -p
RMDIR = rm -rf
RMFILE = rm -f
# if labels above doesn't exist in the input file the values shown
# are considered defaults
# optional modules, subdirectories
MODULES = module1 module2 module3
# any other labels here are preserved but not used
# this could be usefull to use make(1) vars, see next example
DEBUG = -g -pg
[target-name-1]
# this labels are required only if they should be different from
# the defaults above
CC = gcc
LD = gcc
CFLAGS = $(DEBUG)
CCFLAGS = -I../vslib -I/usr/include/ncurses -O2
LDFLAGS = -L../vslib -lvslib -lncurses
SRC = *.cpp # set source files
# if `TARGET' is skipped then the output file name is taken from the
# target name (i.e. `target-name-1' in this example)
TARGET = vfu
[target-name-2]
...
---end-----
label `CFLAGS' is optional and is appended to `CCFLAGS' value
also each label's value can be appended to previous (or to defaults)
with `+=' operator:
---cut---
SRC = vstring.cpp
SRC += vstrlib.cpp
SRC += regexp3.cpp
---cut---
every target can inherit another one:
---cut---
[vstring.a]
CC = g++
LD = g++
CCFLAGS = -I. -O2
TARGET = libvstring.a
SRC = vstring.cpp vstrlib.cpp regexp3.cpp
[debug-vstring.a: vstring.a]
CCFLAGS += -g
TARGET = libvstring_dbg.a
---cut---
i.e. target `debug-vstring.a' inherits `vstring.a' but appends `-g' to
the compile options and changes output file name to `libvstring_dbg.a'
if you set target name to something that ends with `.a' -- makemake.pl
will produce library file target (i.e. will invoke AR instead of LD).
the minimum mm.conf is:
---cut---
[hi]
---cut---
which will produce executable named `hi' out from all sources in the
current directory...
CREDITS ANS MODIFICATIONS (HISTORY)
dec1998: cade@biscom.net, ivo@datamax.bg
* first version *
though there are several utilities like this I still haven't
found what I'm looking for... :)
the closest approach is `tmake' ( `qmake' recently, 2002 ) made by
Troll Tech for their `Qt' toolkit, but is far too complex...
also I wanted it in Perl :)
oct1999: cade@biscom.net
added multi-target feature
aug2000: cade@biscom.net
general cleanup, target clean uses `rm -rf' instead of `rmdir'
added targets `rebuild' and `link' (does `relink' actually)
globbing replaced with the use of `ls'
dec2000: cade@biscom.net
added modules (subdir targets) support:
$MODULES = "module1 module2 ...";
now target name is required and not set to `a.out' by default
mar2001: cade@biscom.net
added $MKDIR,$RMDIR,$RMFILE vars to support non-unix or
non-standard commands for directory and file create/delete
$REF[n] thing and target `re' are back :) see examples below
jun2002: cade@biscom.net
ranlib support (for versions of ar which don't have `s')
oct2002: jambo@datamax.bg
$DEPFLAGS added for optional args for dependency checks.
gcc -MM $DEPFLAGS file...
nov2002: cade@datamax.bg
fixed modules build order (modules first)
dec2002: cade@datamax.bg
input file (mm.conf) format has changed. it is no more perl source
but is simpler. near complete rewrite done.
AUTHORS
(c) Vladi Belperchinov-Shabanski 1998-2002
<cade@biscom.net> <cade@datamax.bg>
(c) Ivaylo Baylov 1998
<ivo@datamax.bg>
LICENSE
DISTRIBUTED UNDER GNU GPL. FOR FULL TEXT SEE ENCLOSED `COPYING' FILE.
FEEDBACK
For any questions, problems, notes contact authors freely! Note that
since Ivo Baylov does not work actively on makemake.pl you should try
first to contact Vladi <cade@biscom.net> or <cade@datamax.bg>
VERSION
$Id: README,v 1.2 2002/12/15 18:20:08 cade Exp $
|