# Untermud makefile
.AUTODEPEND
BCCROOT = $(MAKEDIR)\..
CC = $(BCCROOT)\bin\bcc32
LD = $(BCCROOT)\bin\ilink32
AR = $(BCCROOT)\bin\tlib
YACC = yacc
LEX = flex
WINZIP = C:\apps\Winzip\wzzip
# The suffix appended to executables.
# This should be set for Cygwin and Windows.
EXE = .exe
#EXE =
# Compiler directives for debugging
!ifdef DEBUG
DEBUG_CFLAGS = -v -y -Od -r-
DEBUG_LFLAGS = -v
!else
DEBUG_CFLAGS = -v- -O2
DEBUG_LFLAGS = -v-
!endif
INCDIRS = -I$(BCCROOT)\include
# Compiler/linker directives for linking static or dynamic
!ifdef STATIC
STATIC_CFLAGS =
LIBS = import32.lib cw32mt.lib ws2_32.lib
!else
STATIC_CFLAGS = -tWR
LIBS = import32.lib cw32mti.lib ws2_32.lib
!endif
BCC32STARTUP = c0x32.obj
RAND=RANDOM
MSGS= -w -w-pia -w-par -w-sig -w-use
DEFS= -D$(RAND) -DLEX -DWIN32 -DWIN32_LEAN_AND_MEAN -D_NO_VCL
OPTIM= $(STATIC_CFLAGS) $(DEBUG_CFLAGS) -tWM -tWC -$(PROCESSOR_LEVEL)
CFLAGS= $(OPTIM) $(MSGS) $(DEFS)
LDFLAGS = -Tpe -ap -c -Gn $(DEBUG_LFLAGS)
HDR = config.h wiz_list.h sent.h security.h regexp.h object.h lnode.h \
interpret.h comm.h os.h telnet.h
SRC=lang.y lexical.l main.c lnode.c interpret.c simulate.c object.c backend.c \
comm1.c ed.c regexp.c wiz_list.c swap.c string_space.c os.c
OBJ=lang.obj lexical.obj main.obj lnode.obj interpret.obj simulate.obj \
object.obj backend.obj comm1.obj ed.obj regexp.obj wiz_list.obj \
swap.obj string_space.obj os.obj
XTRA = README CHANGES.1.4.0-A CHANGES Copyright Makefile INSTALL_NOTES IDEA \
makefile.bor makefile.vc restart_mud
MISCSRC = count_active.c
MISCOBJ = $(MISCSRC:.c=.obj)
# Files in the standard distribution
DISTFILES = $(SRC) $(HDR) $(XTRA) $(MISCSRC)
PDIST = $(patsubst %,lpmud\%,$(DISTFILES))
!ifndef RELEASE
RELEASE = dist
!endif
# Dependency information
OBJDEPENDS = $(OBJ) $(MISCOBJ)
TARGETS = parse$(EXE) count_active$(EXE)
all: $(TARGETS)
parse$(EXE) : $(OBJ)
$(LD) $(LDFLAGS) $(BCC32STARTUP) $**, $<,, $(LIBS)
count_active$(EXE) : count_active.obj
$(LD) $(LDFLAGS) $(BCC32STARTUP) $**, $<,, $(LIBS)
lang.c y.tab.h : lang.y
$(YACC) -d lang.y
-move y.tab.c lang.c
lexical.c : lexical.l
$(LEX) lexical.l
-move lex.yy.c lexical.c
clean :
-del *.tds *.map *.TR2 $(TARGETS) lang.c y.tab.h lexical.c $(OBJDEPENDS)
dist : $(DISTFILES)
@echo "Building distribution..."
@-md lpmud
@© /y $** lpmud 1>NUL
@echo .svn > ex.tmp
@xcopy mudlib lpmud\mudlib /I /E /Y /Q /EXCLUDE:ex.tmp
@del ex.tmp
@$(WINZIP) -Pr lpmud-$(RELEASE).zip lpmud 1>NUL 2>NUL
@rd /s /q lpmud
@echo "Done."
.c.obj:
$(CC) $(CFLAGS) $(INCDIRS) -c -n$(@D) $<