Commit f01a062c authored by deuce's avatar deuce
Browse files

New build system!

parent 8202ff36
# GNUmakefile
SRC_ROOT ?= ../..
include ${SRC_ROOT}/build/Common.gmake
#########################################################################
# Makefile for SCFG #
# For use with GNU make and GNU C Compiler #
# @format.tab-size 4, @format.use-tabs true #
# #
# Linux: gmake #
# FreeBSD: gmake os=FreeBSD #
# #
# Optional build targets: clean
#########################################################################
CFLAGS += -DSCFG -I.. $(SMBLIB_CFLAGS) $(UIFC-MT_CFLAGS) $(CIOLIB-MT_CFLAGS) $(XPDEV-MT_CFLAGS)
LDFLAGS += $(SMBLIB_LDFLAGS) $(UIFC-MT_LDFLAGS) $(CIOLIB-MT_LDFLAGS) $(XPDEV-MT_LDFLAGS)
# $Id$
vpath %.c ..
#USE_DIALOG = 1 # Dialog vesrion of UIFC
#USE_FLTK = 1 # Use Windowed version
ifndef NO_CURSES
#USE_CURSES = 1 # Curses version of UIFC
USE_UIFC32 = 1 # NEW curses version of uifc
endif
UIFC_SRC = ../../uifc/
XPDEV = ../../xpdev/
SBBS_SRC = ..
NEED_UIFC := 1
CFLAGS = -DSCFG
SMBLIB_SRC := ../../smblib/
NEED_SMBLIB := 1
include $(XPDEV)/Common.gmake
include $(UIFC_SRC)/Common.gmake
include $(SBBS_SRC)/Common.gmake
include $(SMBLIB_SRC)/Common.gmake
ifeq ($(os),netbsd)
CFLAGS += $(PTHREAD_CFLAGS)
LDFLAGS += $(PTHREAD_LDFLAGS)
endif
SCFG := $(EXEODIR)$(SLASH)scfg$(EXEFILE)
$(SCFG): $(OBJS)
@echo Linking $@
${QUIET}$(CC) $(LDFLAGS) $(MT_LDFLAGS) -o$@ $(OBJS) $(SMBLIB_LIBS) $(UIFC-MT_LIBS) $(CIOLIB-MT_LIBS) $(XPDEV-MT_LIBS)
$(MAKEHELP): makehelp.c
$(QUIET)$(CC) $(CFLAGS) makehelp.c -o $(MAKEHELP)
$(SCFGHELP): $(OBJS) $(MAKEHELP)
$(QUIET)$(MAKEHELP) $(EXEODIR)
# SCFG Build Rule
$(SCFG): $(OBJS)
ifdef USE_DIALOG
$(QUIET)$(MAKE) --no-print-directory -C ../../libdialog
endif
@echo Linking $@
$(QUIET)$(CXX) -o $@ $(OBJS) $(LDFLAGS)
# Makefile
#########################################################################
# Makefile for Synchronet BBS Configuration Utility (SCFG) #
# For use with Borland C++ Builder 5+ or Borland C++ 5.5 for Win32 #
# @format.tab-size 4 #
#########################################################################
# $Id$
# Macros
#DEBUG = 1 # Comment out for release (non-debug) version
#USE_FLTK= 1
USE_UIFC32= 1
CC = bcc32
LD = ilink32
SLASH = \\
OFILE = obj
EXEFILE = .exe
EXEODIR = bcc.win32 # Executable output directory
XPDEV = ..\..\xpdev
UIFC = ..\..\uifc
CIOLIB = ..\..\conio
SMBLIB = ..\..\smblib
LIB = ..\..\..\lib
INCLUDE = ..\..\..\include
CFLAGS = -DSCFG -M -I..;$(UIFC);$(XPDEV);$(CIOLIB);$(SMBLIB)
DELETE = -@echo y | del
.path.c = .;..;$(UIFC);$(XPDEV);$(CIOLIB);$(SMBLIB)
.path.cpp = $(UIFC)
# Enable auto-dependency checking
.autodepend
.cacheautodepend
# Optional compile flags (disable banner, warnings and such)
CFLAGS = $(CFLAGS) -q -d -H -X- -w-csu -w-pch -w-ccc -w-rch -w-par -w-pro -w-8004
#-w-aus
# Debug or release build?
!ifdef DEBUG
CFLAGS = $(CFLAGS) -v -Od -D_DEBUG
LFLAGS = $(LFLAGS) -v
EXEODIR = $(EXEODIR).debug
!else
EXEODIR = $(EXEODIR).release
!endif
LIBODIR = $(EXEODIR)
# Cross platform/compiler definitions
!include targets.mk # defines all targets
!include objects.mk # defines $(OBJS)
!ifdef USE_UIFC32
OBJS = $(OBJS) $(EXEODIR)\uifc32.$(OFILE) \
$(EXEODIR)\ciolib.$(OFILE) $(EXEODIR)\ansi_cio.$(OFILE) $(EXEODIR)\win32cio.$(OFILE) $(EXEODIR)\mouse.$(OFILE)
CFLAGS = $(CFLAGS) -DUSE_UIFC32 -WM
!else
OBJS = $(OBJS) $(EXEODIR)\uifc.$(OFILE)
!endif
!ifdef USE_FLTK
CFLAGS = $(CFLAGS) -DUSE_FLTK -I$(INCLUDE)\fltk
OBJS = $(OBJS) $(EXEODIR)\uifcfltk.$(OFILE) $(LIB)/fltk/win32/fltk.lib
!endif
# Implicit C Compile Rule for SCFG
.c.$(OFILE):
@$(CC) $(CFLAGS) -n$(EXEODIR) -c $<
.cpp.$(OFILE):
@$(CC) $(CFLAGS) -n$(EXEODIR) -c $<
# Create output directory if it doesn't exist
$(EXEODIR):
@if not exist $(EXEODIR) mkdir $(EXEODIR)
SRC_ROOT = ..\..
!include ${SRC_ROOT}\build\Common.bmake
.path.c= .;..
CFLAGS = -DSCFG -I.. $(CFLAGS) $(SMBLIB_CFLAGS) $(UIFC-MT_CFLAGS) $(CIOLIB-MT_CFLAGS) $(XPDEV-MT_CFLAGS)
LDFLAGS = $(LDFLAGS) $(SMBLIB_LDFLAGS) $(UIFC-MT_LDFLAGS) $(CIOLIB-MT_LDFLAGS) $(XPDEV-MT_LDFLAGS)
$(SCFG): $(OBJS)
@echo Linking $@
${QUIET}$(CC) $(LDFLAGS) $(MT_LDFLAGS) -e$@ $(OBJS) $(SMBLIB_LIBS) $(UIFC-MT_LIBS) $(CIOLIB-MT_LIBS) $(XPDEV-MT_LIBS)
$(MAKEHELP): makehelp.c
@$(CC) -q -n$(EXEODIR) $?
$(QUIET)$(CC) $(CFLAGS) -e$(MAKEHELP) makehelp.c
$(SCFGHELP): $(OBJS) $(MAKEHELP)
@$(MAKEHELP) $(EXEODIR)
# Monolithic SCFG executable Build Rule
$(SCFG): $(OBJS)
@echo Linking $@
@$(CC) $(CFLAGS) -e$@ $**
clean:
@echo Deleting $(EXEODIR)
$(QUIET)$(DELETE) $(EXEODIR)\*
$(QUIET)$(MAKEHELP) $(EXEODIR)
......@@ -4,34 +4,25 @@
# $Id$
# LIBODIR, SBBSLIBODIR, SLASH, and OFILE must be pre-defined
# MTLIBODIR, SBBSMTLIBODIR, DIRSEP, and OFILE must be pre-defined
OBJS = $(LIBODIR)$(SLASH)scfg.$(OFILE)\
$(LIBODIR)$(SLASH)scfgxtrn.$(OFILE)\
$(LIBODIR)$(SLASH)scfgmsg.$(OFILE)\
$(LIBODIR)$(SLASH)scfgnet.$(OFILE)\
$(LIBODIR)$(SLASH)scfgnode.$(OFILE)\
$(LIBODIR)$(SLASH)scfgsub.$(OFILE)\
$(LIBODIR)$(SLASH)scfgsys.$(OFILE)\
$(LIBODIR)$(SLASH)scfgxfr1.$(OFILE)\
$(LIBODIR)$(SLASH)scfgxfr2.$(OFILE)\
$(LIBODIR)$(SLASH)scfgchat.$(OFILE)\
$(LIBODIR)$(SLASH)scfgsave.$(OFILE)\
$(LIBODIR)$(SLASH)scfglib1.$(OFILE)\
$(LIBODIR)$(SLASH)smblib.$(OFILE)\
$(LIBODIR)$(SLASH)scfglib2.$(OFILE)\
$(LIBODIR)$(SLASH)load_cfg.$(OFILE)\
$(LIBODIR)$(SLASH)nopen.$(OFILE)\
$(LIBODIR)$(SLASH)crc16.$(OFILE)\
$(LIBODIR)$(SLASH)crc32.$(OFILE)\
$(LIBODIR)$(SLASH)md5.$(OFILE)\
$(LIBODIR)$(SLASH)lzh.$(OFILE)\
$(LIBODIR)$(SLASH)dat_rec.$(OFILE)\
$(LIBODIR)$(SLASH)userdat.$(OFILE)\
$(LIBODIR)$(SLASH)date_str.$(OFILE)\
$(LIBODIR)$(SLASH)str_util.$(OFILE)\
$(LIBODIR)$(SLASH)genwrap.$(OFILE)\
$(LIBODIR)$(SLASH)dirwrap.$(OFILE)\
$(LIBODIR)$(SLASH)filewrap.$(OFILE)\
$(LIBODIR)$(SLASH)uifcx.$(OFILE)
OBJS = $(MTOBJODIR)$(DIRSEP)scfg$(OFILE)\
$(MTOBJODIR)$(DIRSEP)scfgxtrn$(OFILE)\
$(MTOBJODIR)$(DIRSEP)scfgmsg$(OFILE)\
$(MTOBJODIR)$(DIRSEP)scfgnet$(OFILE)\
$(MTOBJODIR)$(DIRSEP)scfgnode$(OFILE)\
$(MTOBJODIR)$(DIRSEP)scfgsub$(OFILE)\
$(MTOBJODIR)$(DIRSEP)scfgsys$(OFILE)\
$(MTOBJODIR)$(DIRSEP)scfgxfr1$(OFILE)\
$(MTOBJODIR)$(DIRSEP)scfgxfr2$(OFILE)\
$(MTOBJODIR)$(DIRSEP)scfgchat$(OFILE)\
$(MTOBJODIR)$(DIRSEP)scfgsave$(OFILE)\
$(MTOBJODIR)$(DIRSEP)scfglib1$(OFILE)\
$(MTOBJODIR)$(DIRSEP)scfglib2$(OFILE)\
$(MTOBJODIR)$(DIRSEP)load_cfg$(OFILE)\
$(MTOBJODIR)$(DIRSEP)nopen$(OFILE)\
$(MTOBJODIR)$(DIRSEP)dat_rec$(OFILE)\
$(MTOBJODIR)$(DIRSEP)userdat$(OFILE)\
$(MTOBJODIR)$(DIRSEP)date_str$(OFILE)\
$(MTOBJODIR)$(DIRSEP)str_util$(OFILE)
......@@ -219,7 +219,7 @@ else
if(!door_mode)
i=uifcinic(&uifc); /* curses */
else
#elif !defined(__unix__) && !defined(_MSC_VER) && !defined(USE_UIFC32)
#elif !defined(__unix__) && !defined(_MSC_VER) && !defined(USE_UIFC32) && 0
if(!door_mode)
i=uifcini(&uifc); /* conio */
else
......
......@@ -6,10 +6,15 @@
# LIBODIR, SLASH, LIBFILE, EXEFILE, and DELETE must be pre-defined
SCFG = $(EXEODIR)$(SLASH)scfg$(EXEFILE)
MAKEHELP= $(EXEODIR)$(SLASH)makehelp$(EXEFILE)
SCFGHELP= $(EXEODIR)$(SLASH)scfghelp.dat
SCFG = $(EXEODIR)$(DIRSEP)scfg$(EXEFILE)
MAKEHELP= $(EXEODIR)$(DIRSEP)makehelp$(EXEFILE)
SCFGHELP= $(EXEODIR)$(DIRSEP)scfghelp.dat
all: $(EXEODIR) \
all: xpdev-mt \
uifc-mt \
ciolib-mt \
smblib \
$(EXEODIR) \
$(MTOBJODIR) \
$(LIBODIR) \
$(SCFG) $(SCFGHELP)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment