diff options
Diffstat (limited to 'pc/Makefile')
-rw-r--r-- | pc/Makefile | 190 |
1 files changed, 21 insertions, 169 deletions
diff --git a/pc/Makefile b/pc/Makefile index 33afe284..4e0511a7 100644 --- a/pc/Makefile +++ b/pc/Makefile @@ -1,35 +1,34 @@ -# Makefile for gawk (GNU awk) Dec 2000 +# Makefile for gawk (GNU awk) Dec 2010 # -# - for GNU C (djgpp) [32bit executable for DOS] +# - for GNU C (djgpp) [32bit protected-mode executable for DOS] # - for GNU C (emx) [32bit executable for OS/2 or DOS or Windows32] -# - for GNU C (mingw32) [Windows32 executable for Windows 9x/NT] -# - for MS-Visual C/C++ 4.x [Windows32 executable for Windows 9x/NT] -# - for Microsoft C 7 [16bit ececutable for DOS] -# - for Microsoft C 6.00A [16bit executable for OS/2 or DOS] +# - for GNU C (mingw32) [Windows32 executable for Windows 9x/NT/2K/XP/7] -# Tested with GNU make and dmake-3.8 under OS/2 and DOS, and ndmake and -# Microsoft nmake under DOS. Compiling with dmake under DOS may require the -# DOS-only version of dmake (so that swapping works). nmake requires a -# few edits in the configuration section below. +# Tested with GNU make on Windows, OS/2 and DOS. default: @echo "Enter $(MAK) target " - @echo " where 'target' is chosen from " + @echo " where 'target' is chosen from " @echo " djgpp ... DOS 32-bit exe [GNU C, Delorie, v2] " - @echo " djgppv1 . DOS 32-bit exe [GNU C, Delorie, v1] " @echo " emx ..... OS/2 32-bit exe [emx/gcc; uses emxlibc.dll] " @echo " emxnt ... NT exe [emx/gcc with RSXNT] " @echo " emxbnd .. OS/2 and DOS 32-bit exe [emx/gcc] " @echo " mingw32 . Windows32 exe [Mingw32 GNU C] " - @echo " msc ..... DOS exe [Microsoft C 7 & 8 (AKA 1.52)] " - @echo " msc6 .... DOS exe [Microsoft C 6.00a] " - @echo " msc6os2 . OS/2 exe [Microsoft C 6.00a] " - @echo " msc6bnd . OS/2 and DOS exe [Microsoft C 6.00a] " - @echo " vcWin32 . Windows32 exe [Microsoft Visual C] " @echo " ----------------------------------------------------- " @echo " test .... Perform tests (see README_d/README.pc) " @echo " install . Install gawk under $(prefix)/ " +# Support dropped in 4.0 +# - for DJGPP v1.x [DOS 32bit protected-mode executable] +# - for MS-Visual C/C++ 4.x [Windows32 executable for Windows 9x/NT] +# - for Microsoft C 7 [16bit ececutable for DOS] +# - for Microsoft C 6.00A [16bit executable for OS/2 or DOS] +# @echo " djgppv1 . DOS 32-bit exe [GNU C, Delorie, v1] " +# @echo " msc ..... DOS exe [Microsoft C 7 & 8 (AKA 1.52)] " +# @echo " msc6 .... DOS exe [Microsoft C 6.00a] " +# @echo " msc6os2 . OS/2 exe [Microsoft C 6.00a] " +# @echo " msc6bnd . OS/2 and DOS exe [Microsoft C 6.00a] " +# @echo " vcWin32 . Windows32 exe [Microsoft Visual C] " # Support dropped in 3.0 # - for Microsoft C 5.1 [16bit executable for OS/2 or DOS] # @echo " msc51 DOS exe [Microsoft C 5.1] " @@ -46,14 +45,6 @@ DRSPFILE = dgawk.rsp #LDRSP = $(GAWKOBJS) #LNKRSP = $(LDRSP) # -# else if make == dmake -# Response files for linker: dmake allows the macro expansion -# $(macro_name:modifier_list:modifier_list:...) -# The macro mktmp creates a temporary file for the linker. -# The 't' modifier is for tokenization. -#LDRSP = @$(mktmp $(<:t"\n")) -#LNKRSP = @$(mktmp $(<:t"+\n") ) # Space before final paren req -# # else use brain-dead approach (emxbnd will need 'tr'). RSP = $(RSPFILE) PRSP = $(PRSPFILE) @@ -83,27 +74,13 @@ pkgdatadir = $(prefix)/lib/awk install = 1 #------------------------------------------------------------------------ # To work around command-line length problems, this makefile assumes -# that $($X) can be expanded. If using a make (such as nmake) which -# cannot handle such macros, define DO_LNK and DO_BIND for your target -# as $(L<target>) and $(B<target>), resp.; e.g., -#DO_LNK = $(LvcWin32) -#DO_PLNK = $(PLvcWin32) -# and then comment the following: +# that $($X) can be expanded. DO_LNK = $($(LNK)) DO_BIND= $($(BIND)) DO_PLNK = $($(PLNK)) DO_PBIND= $($(PBIND)) DO_DLNK = $($(DLNK)) DO_DBIND= $($(DBIND)) -#------------------------------------------------------------------------ -# For dynamic extension support, uncomment these lines -# pick the appropriate .def file entry for your compiler -#DYN_FLAGS=-DDYNAMIC -#DYN_EXP=gawk.exp -#DYN_OBJ=dlfcn$O $(DYN_EXP) -#DYN_MAKEXP=$(DMEvcWin32) -#DYN_MAKEXP=$(DMEmingw32) -# #======================================================================== # End of general configuration. Some platform-specific configuration # notes appear below. @@ -133,16 +110,6 @@ djgpp-debug: LNK=LDJG PLNK=PLDJG DLNK=DLDJG LF2=-lm \ BIND=BDJG PBIND='' DBIND='' -LDJGv1 = $(CC) $(LF) -o gawk $(LDRSP) $(LF2) -#BDJGv1 = coff2exe -s /djgpp/bin/go32.exe gawk -BDJGv1 = coff2exe gawk - -djgppv1: - $(MAK) all \ - CC=gcc O=.o CF=-O \ - LNK=LDJGv1 LF=-s LF2=-lm \ - BIND=BDJGv1 - #======================================================================== #========================== EMX ========================================= #======================================================================== @@ -187,132 +154,17 @@ emxbnd-debug: #========================== MINGW32 ===================================== #======================================================================== -DMEmingw32 = dlltool -D gawk.exe -d gawkw32.def -e gawk.exp -l libgawk.a - LMINGW32 = $(CC) $(LF) -o $@ $(GAWKOBJS) $(LF2) PLMINGW32 = $(CC) $(LF) -o $@ $(PGAWKOBJS) $(LF2) +DLMINGW32 = $(CC) $(LF) -o $@ $(DGAWKOBJS) $(LF2) # The following might work around command-line length limitations: #LMINGW32 = $(CC) $(LF) -o $@ *.o $(LF2) mingw32: $(MAK) all \ CC=gcc O=.o CF="-O2 -gdwarf-2 -g3" OBJ=popen.o \ - LNK=LMINGW32 PLNK=PLMINGW32 LF="-gdwarf-2 -g3" LF2=-lmsvcp60 RSP= - -#======================================================================== -#========================== MSC ========================================= -#======================================================================== - -# stdargv, glob, and director are from Stewartson's sh. These provide -# globbing and enhanced argument-passing. MSC setargv.obj is a -# more limited alternative (and it will permit a bound version). -#STDARGV = stdargv.obj glob.obj director.obj -STDARGV = setargv.obj - -# Optimization and library options: -# Os == optimize for size, Ot == optimize for speed, G2 == 286 or better -#MSCOPT = -Gt3600 -Os -G2 -# MSC seems to be more stable with -Od than with -Ot, but then regexec.c gives -# "code segment too large" error when compiling. Adding -G2y fixes this and -# lets us keep the -Od. -MSCOPT = -Gt3600 -Od -G2y -# Alternate lib, does not use math coprocessor. -#MSCLIB = llibca -#MSCCL = -FPa -# Emulator lib, uses math coprocessor if present. -MSCLIB = llibce -MSCCL = -FPi -#MSCCL = -FPc - -# If the stack gets much smaller than 3000, the "longwrds" test fails. -LMSC = link $(LF) $(LNKRSP) $(STDARGV)/NOE,$@,,/NOD:llibce $(MSCLIB)$(LF2)/STACK:0x2eb0,nul - - -# CLMSC-linking works when building under OS/2 -CLMSC = $(CC) -o $@ $(LF) $(GAWKOBJS) $(STDARGV) $(LF2) -link /NOE/NOI/STACK:0x6f00 - -BMSC = bind $@ /n DOSMAKEPIPE DOSCWAIT - - -# Ugly hack: config.h defines __STDC__ if not defined on command-line. -# OS/2 versions can't use -Za in getid.c. MSC7 uses stub headers in pc/ -# due to ANSI conflicts. MSC 5.1 defines __STDC__=0 regardless of ANSI flag. - -# dmake-3.8 runs out of memory under DOS. Request that dmake -# swap itself out on these targets. Note that this won't have -# any affect on the bound OS/2 and DOS version of dmake-3.8. - -.SWAP: msc msc-debug msc6 msc6os2 msc6bnd msc51 check - -msc: - $(MAK) all \ - "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -Ze -Ipc/include $(MSCOPT)" \ - OBJ=popen.obj \ - LNK=LMSC P=+ -Lmsc = $(LMSC) # for broken makes (nmake) which cannot expand $($X) -Bmsc = - -msc-debug: - $(MAK) all \ - "CC=cl $(MSCCL)" O=.obj "CF=-AL -Ze -Ipc/include -W2 -Zi -Od" \ - OBJ=popen.obj \ - LNK=LMSC LF2=/CO P=+ - -msc6: -# $(MAK) builtin.obj \ -# "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -Za $(MSCOPT) -Od" - $(MAK) all \ - "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -Za $(MSCOPT)" \ - OBJ=popen.obj \ - LNK=LMSC P=+ -Lmsc6 = $(LMSC) # for broken makes (nmake) which cannot expand $($X) -Bmsc6 = - -msc6os2: -# $(MAK) builtin.obj \ -# "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -DOS2 -UMSDOS $(MSCOPT) -Od" - $(MAK) all \ - "CC=cl $(MSCCL)" O=.obj "CF=-AL -DOS2 -UMSDOS $(MSCOPT)" \ - LNK=LMSC "LF2=p,gawk.def" P=+ - -msc6bnd: -# $(MAK) builtin.obj \ -# "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -DOS2 $(MSCOPT) -Od" - $(MAK) all \ - "CC=cl $(MSCCL)" O=.obj "CF=-AL -DOS2 $(MSCOPT)" \ - OBJ=popen.obj \ - LNK=LMSC "LF2=p,gawk.def" P=+ \ - BIND=BMSC -Lmsc6bnd = $(LMSC) # for broken makes (nmake) which cannot expand $($X) -Bmsc6bnd = $(BMSC) - - -# Windows '9x / NT -DMEvcWin32 = lib /def:gawkw32.def /name:gawk.exe /out:gawk.lib -LvcWin32 = link -nologo -subsystem:console -release -out:$@ $(LNKRSP) -PLvcWin32 = link -nologo -subsystem:console -release -out:$@ $(PLDRSP) - -vcWin32: - $(MAK) all \ - "CC=cl -nologo" O=.obj "CF=-o2 -DWIN32 -D__STDC__=0" \ - OBJ=popen.obj \ - LNK=LvcWin32 - - -# Support dropped in 3.0 -#msc51: -# $(MAK) all \ -# "CC=cl $(MSCCL)" O=.obj "CF=-AL -Za -D_MSC_VER=510 $(MSCOPT)" \ -# OBJ=popen.obj \ -# LNK=LMSC P=+ -# -#msc51bnd: -# $(MAK) all \ -# "CC=cl -AL ($MSCCL)" O=.obj "CF=-DOS2 -D_MSC_VER=510 $(MSCOPT)" \ -# OBJ=popen.obj \ -# LNK=CLMSC "LF=-Lp -Fb" "LF2=gawk.def" - -#======================================================================== + LNK=LMINGW32 PLNK=PLMINGW32 DLNK=DLMINGW32 \ + LF="-gdwarf-2 -g3" LF2=-lmsvcp60 RSP= # Define BIND for BINDless compiles, otherwise $($(BIND)) may break. BIND = EMPTY @@ -408,7 +260,7 @@ alloca$O: alloca.c install: install$(install) -install1: +install1: echo extproc sh $(prefix)/bin/igawk.cmd > igawk.cmd echo shift >> igawk.cmd cat pc/awklib/igawk >> igawk.cmd |