Update of /cvsroot/nasm/nasm
In directory usw-pr-cvs1:/tmp/cvs-serv23899
Modified Files:
CHANGES ChangeLog Makefile.in macros.pl nasm.h standard.mac
Added Files:
version version.pl
Removed Files:
nasm-version
Log Message:
Make all version information come from the single file "version".
Introduce new standard __NASM_SUBMINOR__ and __NASM_VER__ macros.
--- NEW FILE: version ---
0.98.31
--- NEW FILE: version.pl ---
#!/usr/bin/perl
#
# version.pl
# $Id: version.pl,v 1.1 2002/05/04 03:57:52 hpa Exp $
#
# Parse the NASM version file and produce appropriate macros
#
# The NASM version number is assumed to consist of:
#
# <major>.<minor>[.<subminor>]<tail>
#
# ... where <tail> is not necessarily numeric.
#
# This defines the following macros:
#
# version.h:
# NASM_MAJOR_VER
# NASM_MINOR_VER
# NASM_SUBMINOR_VER -- this is zero if no subminor
# NASM_VER -- whole version number as a string
#
# version.mac:
# __NASM_MAJOR__
# __NASM_MINOR__
# __NASM_SUBMINOR__
# __NASM_VER__
#
($what) = @ARGV;
$line = <STDIN>;
chomp $line;
if ( $line =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)/ ) {
$maj = $1; $nmaj = $maj+0;
$min = $2; $nmin = $min+0;
$smin = $3; $nsmin = $smin+0;
$tail = $';
} elsif ( $line =~ /^([0-9]+)\.([0-9]+)/ ) {
$maj = $1; $nmaj = $maj+0;
$min = $2; $nmin = $min+0;
$smin = ''; $nsmin = 0;
$tail = $';
} else {
die "$0: Invalid input format\n";
}
if ( $what eq 'h' ) {
print "#ifndef NASM_VERSION_H\n";
print "#define NASM_VERSION_H\n";
printf "#define NASM_MAJOR_VER %d\n", $nmaj;
printf "#define NASM_MINOR_VER %d\n", $nmin;
printf "#define NASM_SUBMINOR_VER %d\n", $nsmin;
printf "#define NASM_VER \"%s\"\n", $line;
print "#endif /* NASM_VERSION_H */\n";
} elsif ( $what eq 'mac' ) {
printf "%%define __NASM_MAJOR__ %d\n", $nmaj;
printf "%%define __NASM_MINOR__ %d\n", $nmin;
printf "%%define __NASM_SUBMINOR__ %d\n", $nsmin;
printf "%%define __NASM_VER__ \"%s\"\n", $line;
} else {
die "$0: Unknown output: $what\n";
}
exit 0;
Index: CHANGES
===================================================================
RCS file: /cvsroot/nasm/nasm/CHANGES,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CHANGES 4 May 2002 01:02:25 -0000 1.4
+++ CHANGES 4 May 2002 03:57:52 -0000 1.5
@@ -2,6 +2,7 @@
-------
* Correctly build in a separate object directory again.
+* Derive all references to the version number from the version file.
0.98.30
Index: ChangeLog
===================================================================
RCS file: /cvsroot/nasm/nasm/ChangeLog,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ChangeLog 4 May 2002 01:02:25 -0000 1.3
+++ ChangeLog 4 May 2002 03:57:52 -0000 1.4
@@ -1,4 +1,13 @@
2002-05-03 H. Peter Anvin <hp...@zy...>
+ * (Makefile.in Mkfiles/*): use new version -> version.{h,mac}.
+ * (macros.pl): support multiple input files (standard.mac, version.mac).
+ * (standard.mac): use an explicit delimiter to end the TASM macros.
+ * (nasm-version): remove, no longer needed.
+ * (version.pl): script to produce version.h and version.mac from version.
+ * (version): contains the official NASM version.
+ * (nasm.h): include version.h.
+
+2002-05-03 H. Peter Anvin <hp...@zy...>
* (configure.in): create output directory.
* (Makefile.in): change cd ; to cd &&.
Index: Makefile.in
===================================================================
RCS file: /cvsroot/nasm/nasm/Makefile.in,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- Makefile.in 4 May 2002 00:15:02 -0000 1.29
+++ Makefile.in 4 May 2002 03:57:52 -0000 1.30
@@ -57,30 +57,30 @@
ndisasm: $(NDISASM)
$(CC) $(LDFLAGS) -o ndisasm $(NDISASM)
-assemble.o: assemble.c nasm.h insnsi.h nasmlib.h assemble.h insns.h
-disasm.o: disasm.c nasm.h insnsi.h disasm.h sync.h insns.h names.c insnsn.c
-eval.o: eval.c eval.h nasm.h insnsi.h nasmlib.h
-float.o: float.c nasm.h insnsi.h
-insnsa.o: insnsa.c nasm.h insnsi.h insns.h
-insnsd.o: insnsd.c nasm.h insnsi.h insns.h
-labels.o: labels.c nasm.h insnsi.h nasmlib.h
-listing.o: listing.c nasm.h insnsi.h nasmlib.h listing.h
-nasm.o: nasm.c nasm.h insnsi.h nasmlib.h preproc.h parser.h assemble.h labels.h \
+assemble.o: assemble.c nasm.h version.h insnsi.h nasmlib.h assemble.h insns.h
+disasm.o: disasm.c nasm.h version.h insnsi.h disasm.h sync.h insns.h names.c insnsn.c
+eval.o: eval.c eval.h nasm.h version.h insnsi.h nasmlib.h
+float.o: float.c nasm.h version.h insnsi.h
+insnsa.o: insnsa.c nasm.h version.h insnsi.h insns.h
+insnsd.o: insnsd.c nasm.h version.h insnsi.h insns.h
+labels.o: labels.c nasm.h version.h insnsi.h nasmlib.h
+listing.o: listing.c nasm.h version.h insnsi.h nasmlib.h listing.h
+nasm.o: nasm.c nasm.h version.h insnsi.h nasmlib.h preproc.h parser.h assemble.h labels.h \
outform.h listing.h insns.h
-nasmlib.o: nasmlib.c nasm.h insnsi.h nasmlib.h names.c insnsn.c
-ndisasm.o: ndisasm.c nasm.h insnsi.h nasmlib.h sync.h disasm.h
-output/outaout.o: output/outaout.c nasm.h insnsi.h nasmlib.h outform.h
-output/outas86.o: output/outas86.c nasm.h insnsi.h nasmlib.h outform.h
-output/outbin.o: output/outbin.c nasm.h insnsi.h nasmlib.h outform.h
-output/outcoff.o: output/outcoff.c nasm.h insnsi.h nasmlib.h outform.h
-output/outdbg.o: output/outdbg.c nasm.h insnsi.h nasmlib.h outform.h
-output/outelf.o: output/outelf.c nasm.h insnsi.h nasmlib.h outform.h
-outform.o: outform.c outform.h nasm.h insnsi.h
-output/outobj.o: output/outobj.c nasm.h insnsi.h nasmlib.h outform.h
-output/outrdf2.o: output/outrdf2.c nasm.h insnsi.h nasmlib.h outform.h
-output/outieee.o: output/outieee.c nasm.h insnsi.h nasmlib.h outform.h
-parser.o: parser.c nasm.h insnsi.h nasmlib.h parser.h float.h names.c insnsn.c
-preproc.o: preproc.c nasm.h insnsi.h nasmlib.h macros.c
+nasmlib.o: nasmlib.c nasm.h version.h insnsi.h nasmlib.h names.c insnsn.c
+ndisasm.o: ndisasm.c nasm.h version.h insnsi.h nasmlib.h sync.h disasm.h
+output/outaout.o: output/outaout.c nasm.h version.h insnsi.h nasmlib.h outform.h
+output/outas86.o: output/outas86.c nasm.h version.h insnsi.h nasmlib.h outform.h
+output/outbin.o: output/outbin.c nasm.h version.h insnsi.h nasmlib.h outform.h
+output/outcoff.o: output/outcoff.c nasm.h version.h insnsi.h nasmlib.h outform.h
+output/outdbg.o: output/outdbg.c nasm.h version.h insnsi.h nasmlib.h outform.h
+output/outelf.o: output/outelf.c nasm.h version.h insnsi.h nasmlib.h outform.h
+outform.o: outform.c outform.h nasm.h version.h insnsi.h
+output/outobj.o: output/outobj.c nasm.h version.h insnsi.h nasmlib.h outform.h
+output/outrdf2.o: output/outrdf2.c nasm.h version.h insnsi.h nasmlib.h outform.h
+output/outieee.o: output/outieee.c nasm.h version.h insnsi.h nasmlib.h outform.h
+parser.o: parser.c nasm.h version.h insnsi.h nasmlib.h parser.h float.h names.c insnsn.c
+preproc.o: preproc.c nasm.h version.h insnsi.h nasmlib.h macros.c
sync.o: sync.c sync.h
# These source files are automagically generated from a single
@@ -97,16 +97,24 @@
insnsn.c: insns.dat insns.pl
perl $(srcdir)/insns.pl -n $(srcdir)/insns.dat
+# These files contains all the standard macros that are derived from
+# the version number.
+version.h: version version.pl
+ perl $(srcdir)/version.pl h < $(srcdir)/version > version.h
+
+version.mac: version version.pl
+ perl $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
+
# This source file is generated from the standard macros file
# `standard.mac' by another Perl script. Again, it's part of the
# standard distribution.
-macros.c: standard.mac macros.pl
- perl $(srcdir)/macros.pl $(srcdir)/standard.mac
+macros.c: macros.pl standard.mac version.mac
+ perl $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
# This target generates all files that require perl.
# This allows easier generation of distribution (see dist target).
-perlreq: macros.c insnsa.c insnsd.c insnsi.h insnsn.c
+perlreq: macros.c insnsa.c insnsd.c insnsi.h insnsn.c version.h version.mac
install: nasm ndisasm
$(INSTALL_PROGRAM) nasm $(INSTALLROOT)$(bindir)/nasm
@@ -150,4 +158,4 @@
dist: spotless perlreq
autoconf
rm -rf ./autom4te.cache
- tar cvjf ../nasm-`./nasm-version`-`date +%Y%m%d`.tar.bz2 ../`./nasm-dir`
+ tar cvjf ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 ../`./nasm-dir`
Index: macros.pl
===================================================================
RCS file: /cvsroot/nasm/nasm/macros.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- macros.pl 30 Apr 2002 21:09:14 -0000 1.7
+++ macros.pl 4 May 2002 03:57:52 -0000 1.8
@@ -11,35 +11,38 @@
my $fname;
my $line = 0;
-my $index = 0;
+my $index = 0;
+my $tasm_count;
-$fname = "standard.mac" unless $fname = $ARGV[0];
-open INPUT,$fname || die "unable to open $fname\n";
-open OUTPUT,">macros.c" || die "unable to open macros.c\n";
+undef $tasm_count;
+open OUTPUT,">macros.c" || die "unable to open macros.c\n";
+
print OUTPUT "/* This file auto-generated from standard.mac by macros.pl" .
- " - don't edit it */\n\n#include <stddef.h>\n\nstatic char *stdmac[] = {\n";
-
-while (<INPUT>) {
+" - don't edit it */\n\n#include <stddef.h>\n\nstatic char *stdmac[] = {\n";
+
+foreach $fname ( @ARGV ) {
+ open INPUT,$fname || die "unable to open $fname\n";
+ while (<INPUT>) {
$line++;
chomp;
- if (m/^\s*((\s*([^"';\s]+|"[^"]*"|'[^']*'))*)\s*(;.*)?$/) {
- $_ = $1;
- s/\\/\\\\/g;
- s/"/\\"/g;
- if (length > 0) {
- print OUTPUT " \"$_\",\n";
- if ($index >= 0) {
- if (m/__NASM_MAJOR__/) {
- $index = -$index;
- } else {
- $index++;
- }
- }
- }
- } else {
- die "$fname:$line: error unterminated quote";
+ if (m/^\s*\*END\*TASM\*MACROS\*\s*$/) {
+ $tasm_count = $index;
+ } elsif (m/^\s*((\s*([^\"\';\s]+|\"[^\"]*\"|\'[^\']*\'))*)\s*(;.*)?$/) {
+ $_ = $1;
+ s/\\/\\\\/g;
+ s/"/\\"/g;
+ if (length > 0) {
+ print OUTPUT " \"$_\",\n";
+ $index++;
+ }
+ } else {
+ die "$fname:$line: error unterminated quote";
}
+ }
+ close(INPUT);
}
-$index = -$index;
-print OUTPUT " NULL\n};\n#define TASM_MACRO_COUNT $index\n"
+print OUTPUT " NULL\n};\n";
+$tasm_count = $index unless ( defined($tasm_count) );
+print OUTPUT "#define TASM_MACRO_COUNT $tasm_count\n";
+close(OUTPUT);
Index: nasm.h
===================================================================
RCS file: /cvsroot/nasm/nasm/nasm.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- nasm.h 30 Apr 2002 21:09:14 -0000 1.37
+++ nasm.h 4 May 2002 03:57:52 -0000 1.38
@@ -11,9 +11,7 @@
#ifndef NASM_NASM_H
#define NASM_NASM_H
-#define NASM_MAJOR_VER 0
-#define NASM_MINOR_VER 98
-#define NASM_VER "0.98.30"
+#include "version.h" /* generated NASM version macros */
#ifndef NULL
#define NULL 0
Index: standard.mac
===================================================================
RCS file: /cvsroot/nasm/nasm/standard.mac,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- standard.mac 30 Apr 2002 21:01:11 -0000 1.7
+++ standard.mac 4 May 2002 03:57:52 -0000 1.8
@@ -1,4 +1,4 @@
-; Standard macro set for NASM 0.98 -*- nasm -*-
+; Standard macro set for NASM -*- nasm -*-
; Macros to make NASM ignore some TASM directives before the first include
; directive.
@@ -10,12 +10,12 @@
%idefine P586
%idefine END
+; This is a magic token which indicates the end of the TASM macros
+*END*TASM*MACROS*
+
; Note that although some user-level forms of directives are defined
; here, not all of them are: the user-level form of a format-specific
; directive should be defined in the module for that directive.
-
-%define __NASM_MAJOR__ 0
-%define __NASM_MINOR__ 98
; These two need to be defined, though the actual definitions will
; be constantly updated during preprocessing.
--- nasm-version DELETED ---
|