!ifndef MSDOS WIN16 WIN32 OS2 # -*- mode: sh; mode: fold -*- # This file has been folded. It is far more comprehensible when viewed with # an editor that supports folding. #{{{ MACRO descriptions This is a master makefile that from which DOS/Windows/OS2 makefiles may be derived. A makefile for a particular system may be derived by passing this through the standalone DOS executable 'mkmake' which should be present in this directory. For example, to produce a makefile suitable for OS2 using the EMX compiler use: mkmake OS2 EMX < makefile.all > Makefile Similarly, mkmake MSDOS BCC < makefile.all > Makefile will produce a makefile for MSDOS and the Borland C compiler. Currently supported environments include: MSDOS WIN16 WIN32 OS2 Currently supported compilers include: MSDOS - BCC, DJGPP, DJGPP_V1 WIN16 - BCC WIN32 - BCC, VC, CYGWIN32, MINGW32 OS2 - EMX, ICC Features include (also edit features.h!) NO_FOLD (The default is to get folding support) More will be added in the future. Each section must define the following macros: CC : The C compiler CFLAGS : Compiler flags P : Path separator used by make/compiler O : Object file extension SRCDIR : SRC location (.) OBJDIR : Directory where objects are placed COMPILE_CMD : Command used to produce object from .c file LINK_CMD : Command used to produce executable LIBDEPS : Other dependencies library depends upon TARGET : Primary target name SLANGLIB : Location of slang library SLANGINC : Location of slang.h TARGET_DEPS : Misc stuff to build COMPILE_DEPS : Dependencies associated with COMPILE_CMD COPY : Copy command Other macros include: RSPFILE : Name of response file RSP_PREFIX : Prefix for response file line (See its usage) RSP_POSTFIX : Postfix for response file line (See its usage) DEF_FILE : *.def file RM : What to use to delete a file Special notes: The P macro could be problematic when its value is a backslash (\). Some make programs may require it to be doubled, i.e., \\. Whatever its value is, it should expand to something that does not include whitespace. Usually this requires that it be followed by a '#' character; however, this may result in the '#' character being quoted, or, escaped if the value of P is a backslash. #}}} !else #rest of file # Note: # This makefile was automatically generated from the master makefile.all. TOOL_PREFIX = !ifdef MSDOS #{{{ ! ifdef DJGPP DJGPP_V1 #{{{ CC = gcc CFLAGS = -O2 -fno-strength-reduce -Wall P = /# path sep O = o # Object extension SRCDIR = .# Location of sources OBJDIR = djgobjs# Location of objects TARGET = $(OBJDIR)/slsh.exe RSPFILE = $(OBJDIR)/link.rsp RSP_PREFIX = RSP_POSTFIX = SLANGINC = ../src SLANGLIB = $(SLANGINC)/$(OBJDIR) COMPILE_CMD = $(CC) -c $(CFLAGS) -I$(SLANGINC) -o # ! ifndef DJGPP_V1 LINK_CMD = $(CC) -s -L$(SLANGLIB) -o $(TARGET) @$(RSPFILE) -lslang ! else GO32 = G:/djgpp/bin/go32.exe ! endif COMPILE_DEPS = TARGET_DEPS = RM = rm COPY = cp #}}} ! elifdef BCC #{{{ CC = bcc CFLAGS = -G- -H -N -O1 -w -ml -Dmsdos P = \\ O = obj SRCDIR = . OBJDIR = bccobjs TARGET = $(OBJDIR)\slsh.exe RSPFILE = $(OBJDR)\bcc.rsp RSP_PREFIX = RSP_POSTFIX = SLANGINC = ..\src SLANGLIB = $(SLANGINC)\$(OBJDIR) COMPILE_CMD = $(CC) -c $(CFLAGS) -I$(SLANGINC) -o# <-- no tailing space LINK_CMD = $(CC) -ml -L$(SLANGLIB) -e$(TARGET) /P=4096 @$(RSPFILE) slang.lib COMPILE_DEPS = TARGET_DEPS = RM = del COPY = copy #}}} ! endif #}}} !endif !ifdef WIN16 #{{{ ! ifdef BCC #{{{ CC = bcc CFLAGS = -G- -H -N -w -ml -Dmsdos -D__WIN16__ -W #CFLAGS = -N -v -H -w -ml -Dmsdos -DMSWINDOWS -WS OBJDIR = mswobjs# Location of objects TARGET = $(OBJDIR)\slsh.exe BCCLIB = C:\BCC31\LIB O = obj # Object extension P = \\ SRCDIR = .# Location of sources SLANGINC = ..\src SLANGLIB = $(SLANGINC)\$(OBJDIR) RSPFILE = $(OBJDIR)\mswin.rsp RSP_PREFIX = RSP_POSTFIX = + COMPILE_CMD = $(CC) -c $(CFLAGS) -I$(SLANGINC) -o# LINK_CMD = tlink /Twe/m/v/c/P/i/s $(BCCLIB)\c0wl @$(RSPFILE) MSWSHELL_EXE = ..\bin\mswshell.exe DEF_FILE = $(OBJDIR)\slsh.def TARGET_DEPS = $(MSWSHELL_EXE) $(DEF_FILE) COMPILE_DEPS = RM = del COPY = copy #}}} ! endif #}}} !endif !ifdef WIN32 #{{{ ! ifdef BCC #{{{ CC = bcc32 #CFLAGS = -G- -H -N -w -D__WIN32__ -W CFLAGS = -G- -H -N -w -W -w-sig -w-stu # Location of objects OBJDIR = bw32objs TARGET = $(OBJDIR)\slsh.exe BCCLIB = C:\BC5\LIB # Object extension O = obj P = \\ # Comment to prevent continuation marker confusion with Borland Make SRCDIR = . RSPFILE = $(OBJDIR)\link.rsp RSPFILE2 = $(OBJDIR)\link2.rsp RSP_PREFIX = RSP_POSTFIX = + COMPILE_CMD = $(CC) -c $(CFLAGS) -I$(SLANGINC) -o LINK_CMD = tlink32 /Tpe /ap /c /x $(BCCLIB)\c0x32 @$(RSPFILE), $(OBJDIR)$(P)slsh.exe, @$(RSPFILE2) DEF_FILE = TARGET_DEPS = $(RSPFILE2) COMPILE_DEPS = RM = del COPY = copy #}}} ! elifdef VC #{{{ # Makefile for slang as Win32 GUI using nmake under Visual C. CC = cl CFLAGS = /nologo /W3 /YX /O2 /D "NDEBUG" /D $(CPU) /D "__WIN32__" /I "." /I $(SLANGINC) /ML /DSLANG_DLL=1 P = \\ O = obj # Object extension SRCDIR = .# Location of sources OBJDIR = mw32objs# Location of objects RSPFILE = RSP_PREFIX = RSP_POSTFIX = COMPILE_RSP = COMPILE_CMD = $(CC) /c $(CFLAGS) /Fo # /Fo specifies object file name TARGET_DEPS = COMPILE_DEPS = RM = del COPY = copy LINK_CMD = link /DLL /SUBSYSTEM:console /LIBPATH:$(SLANGLIB) wslang32.lib -out:$(MOD_DLL) $(MOD_OBJ)# # This needs changing for Windows NT on non-Intel processors CPU = _X86_ #}}} ! elifdef CYGWIN32 MINGW32 #{{{ CC = $(TOOL_PREFIX)gcc P = / ! ifdef CYGWIN32 CFLAGS = -DWIN32 -W -Wall -O2 -fno-strength-reduce -mno-cygwin ! else CFLAGS = -DWIN32 -W -Wall -O2 -fno-strength-reduce ! endif LINK_CMD = $(CC) -s -L$(SLANGLIB) -o $(MOD_DLL) $(MOD_OBJ) -lslang -luser32 OBJDIR = gw32objs# Location of objects O = o # Object extension SRCDIR = .# Location of sources RSPFILE = RSP_PREFIX = RSP_POSTFIX = COMPILE_CMD = $(CC) -c $(CFLAGS) -I$(SLANGINC) -o # COMPILE_DEPS = RM = rm COPY = cp #}}} ! endif TARGET = dlls SLANGINC = ..$(P)src SLANGLIB = ..$(P)src$(P)$(OBJDIR) #}}} !endif !ifdef OS2 #{{{ ! ifdef EMX #{{{ CC = gcc -Zmtd CFLAGS = -DOS2 -D__os2__ P = / O = o # Object extension SRCDIR = .# Location of sources OBJDIR = emxobjs# Location of objects SLANGINC = ../src SLANGLIB = ../src/$(OBJDIR) TARGET = $(OBJDIR)/slsh.exe COMPILE_CMD = $(CC) -c $(CFLAGS) -I$(SLANGINC) -o # DEF_FILE = $(OBJDIR)/slsh.def LINK_CMD = $(CC) -o $(TARGET) $(OBJS) -L$(SLANGLIB) $(DEF_FILE) -lslang -lvideo TARGET_DEPS = $(DEF_FILE) COMPILE_DEPS = RM = del COPY = cp #}}} ! elifdef WCC #{{{ CC = wcc386 CFLAGS = -DOS2 -D__os2__ -bm -bt=os2 # P = \# O = obj # Object extension SRCDIR = .# Location of sources OBJDIR = wccobjs# Location of objects SLANGINC = ..\src SLANGLIB = ..\src\$(OBJDIR)\slang.lib TARGET = $(OBJDIR)\slsh.exe COMPILE_CMD = $(CC) $(CFLAGS) -I=$(SLANGINC) -fo=# DEF_FILE = LINK_CMD = wcl386 -fe=$(TARGET) $(OBJS) $(SLANGLIB) -k150000 # -lvideo TARGET_DEPS = COMPILE_DEPS = RM = del COPY = copy #}}} ! elifdef ICC #{{{ CC = icc CFLAGS = -Q+ -W3 -DOS2 -D__os2__ -Gm+ -Wcnd- P = \# O = obj SRCDIR = . OBJDIR = iccobjs SLANGINC = ..\src SLANGLIB = ..\src\$(OBJDIR)\slang.lib TARGET = $(OBJDIR)\slsh.exe COMPILE_CMD = $(CC) -c $(CFLAGS) -I$(SLANGINC) -Fo# <-- no trailing space DEF_FILE = LINK_CMD = $(CC) -Fe$(TARGET) $(OBJS) $(SLANGLIB) TARGET_DEPS = COMPILE_DEPS = RM = del COPY = copy #}}} ! endif #}}} !endif # End of compiler specific section # --------------------------------------------------------------------------- # List of modules to compile. Some/Most require additional libraries to be # installed. MODULES = slsmg iconv png # slsmg: no external dependencies # iconv: iconv library # png: png library # pcre: Ported to Win32 by GnuWin32 group. # onig # varray-module.c: No external libs but requires porting to windows. # --------------------------------------------------------------------------- # Module-specific paths --- these may need tweaked for the compiler ICONVDIR=..$(P)..$(P)iconv ICONVLIBPATH=/LIBPATH:$(ICONVDIR)$(P)lib ICONVINCPATH=/I$(ICONVDIR)$(P)include PNGINCPATH= PNGLIBPATH= ONIGDIR=..$(P)..$(P)onig ONIGLIBPATH=/LIBPATH:$(ONIGDIR)$(P)lib ONIGINCPATH=/I$(ONIGDIR)$(P)include #---------------------------------------------------------------------------- all: $(MODULES) #iconv-module.c $(OBJDIR)$(P)iconv-module.dll: $(OBJDIR) $(OBJDIR)$(P)iconv-module.$(O) $(LINK_CMD)$(OBJDIR)$(P)iconv-module.dll $(ICONVLIBPATH) $(OBJDIR)$(P)iconv-module.$(O) iconv.lib $(OBJDIR)$(P)iconv-module.$(O): $(SRCDIR)$(P)iconv-module.c $(COMPILE_CMD)$(OBJDIR)$(P)iconv-module.$(O) $(ICONVINCPATH) $(SRCDIR)$(P)iconv-module.c #onig-module.c $(OBJDIR)$(P)onig-module.dll: $(OBJDIR) $(OBJDIR)$(P)onig-module.$(O) $(LINK_CMD)$(OBJDIR)$(P)onig-module.dll $(ONIGLIBPATH) $(OBJDIR)$(P)onig-module.$(O) onig.lib $(OBJDIR)$(P)onig-module.$(O): $(SRCDIR)$(P)onig-module.c $(COMPILE_CMD)$(OBJDIR)$(P)onig-module.$(O) $(ONIGINCPATH) $(SRCDIR)$(P)onig-module.c #slsmg-module.c $(OBJDIR)$(P)slsmg-module.dll: $(OBJDIR) $(OBJDIR)$(P)slsmg-module.$(O) $(LINK_CMD)$(OBJDIR)$(P)slsmg-module.dll $(OBJDIR)$(P)slsmg-module.$(O) $(OBJDIR)$(P)slsmg-module.$(O): $(SRCDIR)$(P)slsmg-module.c $(COMPILE_CMD)$(OBJDIR)$(P)slsmg-module.$(O) $(SRCDIR)$(P)slsmg-module.c #png-module.c $(OBJDIR)$(P)png-module.dll: $(OBJDIR) $(OBJDIR)$(P)png-module.$(O) $(LINK_CMD)$(OBJDIR)$(P)png-module.dll $(PNGLIBPATH) $(OBJDIR)$(P)png-module.$(O) png.lib $(OBJDIR)$(P)png-module.$(O): $(SRCDIR)$(P)png-module.c $(COMPILE_CMD)$(OBJDIR)$(P)png-module.$(O) $(PNGINCPATH) $(SRCDIR)$(P)png-module.c # $(OBJDIR) : -mkdir $(OBJDIR) clean: $(RM) $(OBJDIR)$(P)*.$(O) # .PHONY: $(MODULES) !endif #NOT HELP