Clean up Makefile.unx and document it better
authorH. Peter Anvin <hpa@zytor.com>
Sun, 26 May 2002 22:43:16 +0000 (22:43 +0000)
committerH. Peter Anvin <hpa@zytor.com>
Sun, 26 May 2002 22:43:16 +0000 (22:43 +0000)
Mkfiles/Makefile.unx
Mkfiles/README

index 6d4c7bf..012edec 100644 (file)
 prefix = /usr/local
 CC = cc
 CFLAGS = -O -I.
+PERL = perl
 
-# You _shouldn't_ need to adjust anything below this line.
+INSTALL = install -c
+INSTALL_PROGRAM = $(INSTALL)
+INSTALL_DATA = $(INSTALL) -m 644
 
-exec_prefix = ${prefix}
-bindir = ${exec_prefix}/bin
-mandir = ${prefix}/man
+exec_prefix = $(prefix)
+bindir = $(exec_prefix)/bin
+mandir = $(prefix)/man
 
-INSTALL = install -c
-INSTALL_PROGRAM = ${INSTALL}
-INSTALL_DATA = ${INSTALL} -m 644
+# You _shouldn't_ need to adjust anything below this line.
+
+.SUFFIXES: .c .o .h .mac .pl
 
 .c.o:
-       $(CC) -c $(CFLAGS) -o $@ $*.c
+       $(CC) -c $(CFLAGS) $<
 
-NASM = nasm.o nasmlib.o float.o insnsa.o assemble.o labels.o \
-       parser.o outform.o output/outbin.o output/outaout.o output/outcoff.o output/outelf.o \
-       output/outobj.o output/outas86.o output/outrdf.o output/outdbg.o preproc.o listing.o \
-       eval.o output/outrdf2.o output/outieee.o
+NASM =         nasm.o nasmlib.o float.o insnsa.o assemble.o labels.o \
+               parser.o outform.o output/outbin.o output/outaout.o \
+       output/outcoff.o output/outelf.o \
+               output/outobj.o output/outas86.o output/outdbg.o preproc.o listing.o \
+               eval.o output/outrdf2.o output/outieee.o
 
 NDISASM = ndisasm.o disasm.o sync.o nasmlib.o insnsd.o
 
@@ -71,20 +75,29 @@ sync.o: sync.c sync.h
 # These files contains all the standard macros that are derived from
 # the version number.
 version.h: version version.pl
-       perl version.pl h < version > version.h
+       $(PERL) version.pl h < version > version.h
 
 version.mac: version version.pl
-       perl version.pl mac < version > version.mac
+       $(PERL) version.pl mac < 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: macros.pl standard.mac version.mac
-       perl macros.pl standard.mac version.mac
+       $(PERL) macros.pl standard.mac version.mac
+
+insnsa.c: insns.pl insns.dat
+       $(PERL) insns.pl -a insns.dat
+
+insnsd.c: insns.pl insns.dat
+       $(PERL) insns.pl -d insns.dat
+
+insnsi.h: insns.pl insns.dat
+       $(PERL) insns.pl -i insns.dat
 
-insnsa.c insnsd.c insnsi.h insnsn.c: insns.dat insns.pl
-       perl insns.pl insns.dat
+insnsn.c: insns.pl insns.dat
+       $(PERL) insns.pl -n insns.dat
 
 # This target generates all files that require perl.
 # This allows easier generation of distribution (see dist target).
index 6bde23b..33dc7f7 100644 (file)
@@ -26,6 +26,13 @@ The Makefiles are:
   Makefile.os2 OS/2 Warp       Borland C++
   Makefile.sc  32-bit DOS      Symantec C++ 7
   Makefile.scw Win32           Symantec C++ 7
-  Makefile.unx Unix            cc              use if "configure" fails
+  Makefile.unx Unix            Any(*)          use only if "configure" fails
   Makefile.vc  Win32           MS Visual C++   OK as of NASM 0.98.32
   Makefile.wcw Win32           Watcom C
+
+
+(*) = This Makefile should work with any compiler which is ANSI
+      C89/ISO C90 compliant and that uses the standard Unix compiler
+      arguments, such as -c and -O.  Pre-ANSI compilers, such as the
+      "cc" distributed with SunOS 4.x, will not work.
+