Skip to content
Snippets Groups Projects
Commit afc98bdf authored by rswindell's avatar rswindell
Browse files

First attempt to Linux/Unix compatibility. Not tested. To build for win32, use 'make os=win32'

parent 397f6800
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,10 @@
#########################################################################
# Makefile for Synchronet BBS #
# For use with GNU make and GNU C Compiler #
# @format.tab-size 4 #
# @format.tab-size 4, @format.use-tabs true #
# #
# Linux: make -f Makefile.gnu #
# Win32: make -f Makefile.gnu os=win32 #
#########################################################################
# $Id$
......@@ -11,14 +14,29 @@
# Macros
DEBUG = 1 # Comment out for release (non-debug) version
CC = gcc
LD = dllwrap
SLASH = /
OFILE = o
ifeq ($(os),win32) # Windows
LD = dllwrap
LFILE = dll
ODIR := gcc.win32.dll
LIBDIR := /gcc/i386-mingw32/lib
CFLAGS := -mno-cygwin
LFLAGS := --target=i386-mingw32 -mno-cygwin
else # Linux
LD = ld
LFILE = a
ODIR := lib
LIBDIR := /usr/lib
CFLAGS :=
LFLAGS :=
endif
ifdef DEBUG
CFLAGS := $(CFLAGS) -g -O0 -D_DEBUG
ODIR := $(ODIR).debug
......@@ -27,11 +45,11 @@ LFLAGS := $(LFLAGS) -S
ODIR := $(ODIR).release
endif
SBBS = $(ODIR)/sbbs.dll
SBBS = $(ODIR)/sbbs.$(LFILE)
FTPSRVR = $(ODIR)/ftpsrvr.dll
FTPSRVR = $(ODIR)/ftpsrvr.$(LFILE)
MAILSRVR= $(ODIR)/mailsrvr.dll
MAILSRVR= $(ODIR)/mailsrvr.$(LFILE)
SBBSLIB = $(ODIR)/sbbs.a
......@@ -43,11 +61,11 @@ include sbbsdefs.mak # defines $(SBBSDEFS)
LIBS = $(LIBDIR)/libwsock32.a $(LIBDIR)/libwinmm.a
# Implicit C Compile Rule for SBBS.DLL
# Implicit C Compile Rule for SBBS
$(ODIR)/%.o : %.c
$(CC) $(CFLAGS) -c $(SBBSDEFS) $< -o $@
# Implicit C++ Compile Rule for SBBS.DLL
# Implicit C++ Compile Rule for SBBS
$(ODIR)/%.o : %.cpp
$(CC) $(CFLAGS) -c $(SBBSDEFS) $< -o $@
......@@ -55,15 +73,15 @@ $(ODIR)/%.o : %.cpp
$(ODIR):
mkdir $(ODIR)
# SBBS DLL Link Rule
# SBBS Link Rule
$(SBBS): $(OBJS) $(ODIR)/ver.o
$(LD) $(LFLAGS) -o $@ $^ $(LIBS) --output-lib $(SBBSLIB)
# FTP Server DLL Link Rule
# FTP Server Link Rule
$(FTPSRVR): $(ODIR)/ftpsrvr.o $(SBBSLIB)
$(LD) $(LFLAGS) -o $@ $^ $(LIBS) --output-lib $(ODIR)/ftpsrvr.a
# Mail Server DLL Link Rule
# Mail Server Link Rule
$(MAILSRVR): $(ODIR)/mailsrvr.o $(ODIR)/mxlookup.o $(SBBSLIB)
$(LD) $(LFLAGS) -o $@ $^ $(LIBS) --output-lib $(ODIR)/mailsrvr.a
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment