# $Id: Makefile.win32,v 1.15 2010/05/24 22:19:26 amold Exp $ # Makefile.std 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria # # With an input editor, command completion, etc. and ported to all sorts of # things; Paul Placeway, CIS Dept., Ohio State University # # # Windows NT version: Amol Deshpande, Microsoft Corp. # ################################################################ ## CFLAGS. For various -D things, see config.h ################################################################ # # These are the default suffixes from .c to .o and -c to get there # but to use the global optimizer on the mips boxes, see below # SUF=obj CF=-c -nologo INCLUDES=-I. -I.. -Iwin32 DEBUG_CRTLIBS= libcmtd.lib oldnames.lib libcpmtd.lib CRTLIBS= libcmt.lib oldnames.lib libcpmt.lib EXTRAFLAGS = -DWINNT_NATIVE -DNO_CRYPT -DHAVE_DIRENT_H $(EFL) WINDOWS_WARNING_LEVEL=-W4 -WX REST_WARNING_LEVEL=-WX -W3 ANALYZE_FLAGS = -analyze !if "$(PROCESSOR_ARCHITECTURE)" == "AMD64" #main code is broken for 64-bit. ignore warnings and pray it works REST_WARNING_LEVEL= -W3 ANALYZE_FLAGS= IGNORE_64= -wd4244 -wd4267 !if "$(WIN64)" == "" !Message !Message Assuming x64 compile. pass WIN64=0 in command line if compiling 32-bit !Message WIN64=1 !endif !endif !if "$(WIN64)" == "" WIN64=0 ARCH=x86 !else ARCH=x64 WIN64=1 !endif BUILD=tcsh-$(ARCH).exe !if "$(BLDTYPE)" == "" BLDTYPE=retail !endif !if "$(BLDTYPE)" == "debug" NTLDFLAGS= -entry:silly_entry -debug NTCFLAGS = -Zi -DNTDBG -Od LIBES= user32.lib advapi32.lib kernel32.lib $(DEBUG_CRTLIBS) strsafe.lib !else if "$(BLDTYPE)" == "retail" NTLDFLAGS= -entry:silly_entry -debug NTCFLAGS = -Zi -O2 LIBES= user32.lib advapi32.lib kernel32.lib $(CRTLIBS) strsafe.lib !else !ERROR Unknown compilation mode $(BLDTYPE). Set debug or retail !endif !if "$(WIN64)" == "1" NTCFLAGS = $(NTCFLAGS) -Zp8 !endif CFLAGS= -MT $(NTCFLAGS) $(INCLUDES) LDFLAGS= -nodefaultlib $(NTLDFLAGS) -stack:1048576,524288 CC= cl ED= ed RM= -del # # Resources. which icon you want to use. NTRES = BSDLOGO ASSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \ sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \ sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \ sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h PSSRCS= sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \ vms.termcap.c SHSRCS= $(ASSRCS) $(PSSRCS) SHOBJS= sh.$(SUF) sh.dir.$(SUF) sh.dol.$(SUF) sh.err.$(SUF) sh.exec.$(SUF) \ sh.char.$(SUF) sh.exp.$(SUF) sh.func.$(SUF) sh.glob.$(SUF) \ sh.hist.$(SUF) sh.init.$(SUF) sh.lex.$(SUF) sh.misc.$(SUF) \ sh.parse.$(SUF) sh.print.$(SUF) sh.proc.$(SUF) sh.sem.$(SUF) \ sh.set.$(SUF) sh.time.$(SUF) glob.$(SUF) mi.termios.$(SUF) \ ma.setp.$(SUF) TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \ tw.comp.c tw.color.c TWOBJS= tw.help.$(SUF) tw.init.$(SUF) tw.parse.$(SUF) tw.spell.$(SUF) \ tw.comp.$(SUF) tw.color.$(SUF) EDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \ ed.refresh.c ed.xmap.c ed.term.c ed.term.h EDOBJS= ed.chared.$(SUF) ed.refresh.$(SUF) ed.init.$(SUF) \ ed.inputl.$(SUF) ed.defns.$(SUF) ed.xmap.$(SUF) ed.term.$(SUF) TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \ tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c tc.nsl.c \ tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \ tc.who.c tc.h TCOBJS= tc.alloc.$(SUF) tc.bind.$(SUF) tc.const.$(SUF) \ tc.disc.$(SUF) tc.func.$(SUF) tc.os.$(SUF) tc.printf.$(SUF) tc.nls.$(SUF) \ tc.prompt.$(SUF) tc.sched.$(SUF) tc.sig.$(SUF) tc.str.$(SUF) \ tc.vers.$(SUF) tc.who.$(SUF) NTSRCS = win32\io.c win32\stdio.c win32\dirent.c win32\signal.c\ win32\support.c \ win32\nt.char.c win32\bogus.c win32\console.c win32\fork.c \ win32\ntfunc.c win32\ntb1.c win32\ntb2.c win32\globals.c \ win32\nt.who.c win32\ps.c win32\clip.c win32\nt.const.c \ win32\nt.bind.c win32\nt.screen.c NTOBJS = io.$(SUF) stdio.$(SUF) dirent.$(SUF) signal.$(SUF) support.$(SUF) \ nt.char.$(SUF) bogus.$(SUF) console.$(SUF) fork.$(SUF) ntfunc.$(SUF) \ globals.$(SUF) nt.who.$(SUF) ps.$(SUF) \ clip.$(SUF) nt.const.$(SUF) nt.bind.$(SUF) nt.screen.$(SUF) VHSRCS=$(PVSRCS) $(AVSRCS) ALLSRCS= $(SHSRCS) $(TWSRCS) $(EDSRCS) $(TCSRCS) $(VHSRCS) $(NTSRCS) DISTSRCS= $(PSSRCS) $(TWSRCS) $(EDSRCS) $(TCSRCS) $(AVSRCS) OBJS= $(SHOBJS) $(TWOBJS) $(EDOBJS) $(TCOBJS) $(NTOBJS) all: $(BUILD) $(BUILD): $(OBJS) ntb1.$(SUF) ntb2.$(SUF) win32/$(NTRES).res link $(LDFLAGS) ntb1.$(SUF) $(OBJS) $(LIBES) ntb2.$(SUF) $(EXTRALIBS) \ win32/$(NTRES).res $(LOADABLE_RES) -map:tcsh.map -out:$(BUILD) gcompress:$(BUILD) gzip -v9 $(BUILD) bintar: gcompress tar -cvf tcsh-$(ARCH)-bin.tar $(BUILD) win32/README.NT \ win32/example.tcshrc win32/tcsh-html.tgz win32/bin gzip -v9 tcsh-$(ARCH)-bin.tar move tcsh-$(ARCH)-bin.tar.gz .. win32srctar: $(NTSRCS) tar -cvf tcshwin32src.tar win32 --exclude win32/bin gzip -v9 tcshwin32src.tar move tcshwin32src.tar.gz .. chlog: tcsh -fc "echo \