updated old files to new implementation

This commit is contained in:
crs 2001-10-06 14:18:01 +00:00
parent ff81f708e2
commit 23f1b1aba1
2 changed files with 74 additions and 86 deletions

View File

@ -1,12 +1,10 @@
#
# empty define, used to terminate lists
#
NULL =
# #
# build tools # build tools
# #
AR = /usr/bin/ar cru
CD = cd
CXX = /usr/bin/g++ CXX = /usr/bin/g++
ECHO = echo
LD = /usr/bin/ld LD = /usr/bin/ld
MKDIR = /bin/mkdir MKDIR = /bin/mkdir
RM = /bin/rm -f RM = /bin/rm -f
@ -15,12 +13,8 @@ RMR = /bin/rm -rf
# #
# compiler options # compiler options
# #
CXXFLAGS = $(LCXXFLAGS) $(GCXXFLAGS) $(CXXOPTIMIZER) $(MKDEPOPT) GCXXDEFS = -D_POSIX_C_SOURCE=199309
LCXXFLAGS = $(LCXXDEFS) $(LCXXINCS) $(LCXXOPTS) GCXXINCS = -I$(DEPTH)/include -I/usr/X11R6/include
GCXXFLAGS = $(GCXXDEFS) $(GCXXINCS) $(GCXXOPTS)
GCXXDEFS = -D_POSIX_SOURCE
GCXXINCS = -I$(DEPTH)/include -I/usr/include -I/usr/X11R6/include
GCXXOPTS = -Wall -W -fexceptions -fno-rtti GCXXOPTS = -Wall -W -fexceptions -fno-rtti
CXXOPTIMIZER = -g CXXOPTIMIZER = -g
#CXXOPTIMIZER = -O2 -DNDEBUG #CXXOPTIMIZER = -O2 -DNDEBUG
@ -28,12 +22,13 @@ CXXOPTIMIZER = -g
# #
# linker options # linker options
# #
LDFLAGS = $(LDOPTS) $(LDLIBS)
LDOPTS = $(LLDOPTS) $(GLDOPTS)
LDLIBS = $(LLDLIBS) $(GLDLIBS)
GLDLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXtst GLDLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXtst
GLDOPTS = GLDOPTS = -L$(LIBDIR)
#
# library stuff
#
LIBTARGET = $(LIBDIR)/lib$(TARGET).a
# #
# dependency generation stuff # dependency generation stuff
@ -44,12 +39,6 @@ MKDEPPRE =
MKDEPPOST = $(MKDEP) -f $(MKDEPFILE) $*.d; $(RM) $*.d MKDEPPOST = $(MKDEP) -f $(MKDEPFILE) $*.d; $(RM) $*.d
MKDEPFILE = Makedepend MKDEPFILE = Makedepend
#
# Convenience file list macros:
#
SOURCES = $(CXXFILES)
OBJECTS = $(CXXFILES:.cpp=.o)
# #
# stuff to clean # stuff to clean
# #
@ -57,47 +46,21 @@ DIRT = $(_FORCE) $(LDIRT) $(GDIRT)
GDIRT = *.[eoud] a.out core ar.tmp.* $(MKDEPFILE) GDIRT = *.[eoud] a.out core ar.tmp.* $(MKDEPFILE)
# #
# always unsatisfied target # Rule macros for nonterminal makefiles that iterate over subdirectories,
# making the current target. Set SUBDIRS to the relevant list of kids.
# #
_FORCE = $(COMMONPREF)_force # Set NOSUBMESG to any value to suppress a warning that subdirectories
# are not present.
#
SUBDIR_MAKERULE= \
if test ! -d $$d; then \
if test "$(NOSUBMESG)" = "" ; then \
${ECHO} "SKIPPING $$d: No such directory."; \
fi \
else \
${ECHO} "${CD} $$d; $(MAKE) $${RULE:=$@}"; \
(${CD} $$d; ${MAKE} $${RULE:=$@}); \
fi
# SUBDIRS_MAKERULE= \
# @for d in $(SUBDIRS); do $(SUBDIR_MAKERULE); done
# common rules
#
#
#
# default target. makefiles must define a target named `targets'.
#
default: targets
#
# always unsatisfied target
#
$(_FORCE):
#
# cleaners
#
COMMONTARGETS = clean clobber
$(COMMONPREF)clean: $(_FORCE)
$(RM) $(DIRT)
$(COMMONPREF)clobber: clean $(_FORCE)
$(RM) $(TARGETS)
#
# implicit target rules
#
.SUFFIXES: .cpp .o
.cpp.o:
$(MKDEPPRE)
$(CXX) $(CXXFLAGS) -c $<
$(MKDEPPOST)
#
# load dependencies
#
sinclude $(MKDEPFILE)

View File

@ -1,38 +1,63 @@
DEPTH=. DEPTH=.
include Make-linux COMMONPREF = root
include Makecommon
# #
# target files # subdirectories
#
SUBDIRS = \
base \
mt \
io \
net \
$(NULL)
#
# targets
#
default: $(COMMONPREF)_force
$(SUBDIRS_MAKERULE)
all targets: default
clean:
$(RMR) $(LIBDIR)
$(SUBDIRS_MAKERULE)
clobber:
$(RMR) $(LIBDIR)
$(SUBDIRS_MAKERULE)
#
#
# test
#
# #
TARGETS = main
# #
# source files # source files
# #
CXXFILES = \ LCXXINCS = \
XBase.cpp \ -I$(DEPTH)/base \
CTrace.cpp \ -I$(DEPTH)/mt \
CEventQueue.cpp \ -I$(DEPTH)/io \
CSocket.cpp \ -I$(DEPTH)/net \
CMessageSocket.cpp \
CSocketFactory.cpp \
CServer.cpp \
CClient.cpp \
CScreenProxy.cpp \
CXScreen.cpp \
CUnixXScreen.cpp \
CUnixTCPSocket.cpp \
CUnixEventQueue.cpp \
main.cpp \
$(NULL) $(NULL)
CXXFILES = test.cpp
# #
# libraries we depend on # libraries we depend on
# #
DEPLIBS = \ DEPLIBS = \
$(LIBDIR)/libnet.a \
$(LIBDIR)/libio.a \
$(LIBDIR)/libmt.a \
$(LIBDIR)/libbase.a \
$(NULL)
LLDLIBS = \
$(DEPLIBS) \
-lpthread \
$(NULL) $(NULL)
targets: $(TARGETS) test: $(OBJECTS) $(DEPLIBS)
main: $(OBJECTS) $(DEPLIBS)
$(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LDFLAGS) $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LDFLAGS)