2017-03-18 13:04:38 +00:00
|
|
|
# Makefile for Linux
|
|
|
|
|
|
|
|
# General
|
|
|
|
|
|
|
|
PLATFORMDEF = -DPLATFORM_LINUX
|
|
|
|
EXESUFFIX =
|
|
|
|
|
2017-03-18 22:21:30 +00:00
|
|
|
OS := $(shell uname -s)
|
2017-03-18 22:13:25 +00:00
|
|
|
|
2017-03-18 13:04:38 +00:00
|
|
|
BINDIR = ../bin
|
|
|
|
OBJDIR = obj
|
|
|
|
INCDIR = ./
|
|
|
|
|
|
|
|
OSLIB = oslib_linux/oslib.a
|
|
|
|
JAMLIB = ../../../deps/jamlib/jamlib.a
|
|
|
|
CMNLLIB = cmnllib/cmnllib.a
|
|
|
|
|
|
|
|
# Nodelists
|
|
|
|
|
|
|
|
NLDEFS = -DNODELIST_CMNL -DNODELIST_V7P
|
|
|
|
NLOBJS = obj/nl_v7p.o obj/nl_cmnl.o $(CMNLLIB)
|
|
|
|
|
|
|
|
# Messagebases
|
|
|
|
|
|
|
|
# *.msg
|
|
|
|
MBDEFS_MSG = -DMSGBASE_MSG
|
|
|
|
MBOBJS_MSG = obj/mb_msg.o
|
|
|
|
|
|
|
|
# JAM
|
|
|
|
MBDEFS_JAM = -DMSGBASE_JAM
|
|
|
|
MBOBJS_JAM = $(OBJDIR)/mb_jam.o $(JAMLIB)
|
|
|
|
|
|
|
|
MBDEFS_SQ3 = -DMSGBASE_SQ3
|
|
|
|
MBOBJS_SQ3 = $(OBJDIR)/mb_sq3.o
|
|
|
|
|
|
|
|
# Sum them up. Only include the messagebases you want to use
|
|
|
|
MBDEFS = $(MBDEFS_MSG) $(MBDEFS_JAM) $(MBDEFS_SQ3)
|
|
|
|
MBOBJS = $(MBOBJS_MSG) $(MBOBJS_JAM) $(MBOBJS_SQ3)
|
|
|
|
|
|
|
|
DEFS = $(PLATFORMDEF) $(MBDEFS) $(NLDEFS)
|
|
|
|
|
2017-10-19 21:27:58 +00:00
|
|
|
ifeq ($(OS), SunOS)
|
|
|
|
SLIBS = -lsocket -lnsl
|
|
|
|
else
|
|
|
|
SLIBS =
|
|
|
|
endif
|
|
|
|
|
2017-03-18 13:04:38 +00:00
|
|
|
# Commands
|
2018-01-19 07:13:06 +00:00
|
|
|
ifeq ($(OS), $(filter $(OS), FreeBSD DragonFly OpenBSD))
|
2017-03-19 02:53:10 +00:00
|
|
|
CC = cc $(CPPFLAGS) $(CFLAGS) $(DEFS) $(LDFLAGS) -L/usr/local/lib -I $(INCDIR) -I ../../../deps/ -I/usr/local/include -Wall
|
2017-03-18 22:06:01 +00:00
|
|
|
else
|
|
|
|
CC = gcc $(CPPFLAGS) $(CFLAGS) $(DEFS) $(LDFLAGS) -I $(INCDIR) -I ../../../deps/ -Wall
|
|
|
|
endif
|
2017-03-18 13:04:38 +00:00
|
|
|
RM = rm -f
|
|
|
|
STRIP = strip
|
|
|
|
|
|
|
|
# Objects
|
|
|
|
|
|
|
|
SHOBJS = $(OBJDIR)/jblist.o \
|
|
|
|
$(OBJDIR)/jbstrcpy.o \
|
|
|
|
$(OBJDIR)/mystrncpy.o \
|
|
|
|
$(OBJDIR)/parseargs.o \
|
|
|
|
$(OBJDIR)/node4d.o \
|
|
|
|
$(OBJDIR)/expr.o \
|
|
|
|
$(OBJDIR)/path.o
|
|
|
|
|
|
|
|
CMOBJS = $(OBJDIR)/magimail.o \
|
|
|
|
$(OBJDIR)/logwrite.o \
|
|
|
|
$(OBJDIR)/dupe.o \
|
|
|
|
$(OBJDIR)/stats.o \
|
|
|
|
$(OBJDIR)/misc.o \
|
|
|
|
$(OBJDIR)/safedel.o \
|
|
|
|
$(OBJDIR)/toss.o \
|
|
|
|
$(OBJDIR)/pkt.o \
|
|
|
|
$(OBJDIR)/mb.o \
|
|
|
|
$(OBJDIR)/nl.o \
|
|
|
|
$(OBJDIR)/handle.o \
|
|
|
|
$(OBJDIR)/node4dpat.o \
|
|
|
|
$(OBJDIR)/config.o \
|
|
|
|
$(OBJDIR)/memmessage.o \
|
|
|
|
$(OBJDIR)/scan.o \
|
|
|
|
$(OBJDIR)/outbound.o \
|
|
|
|
$(OBJDIR)/filter.o \
|
2017-03-22 22:35:00 +00:00
|
|
|
$(OBJDIR)/areafix.o \
|
|
|
|
$(OBJDIR)/broadcast.o
|
2017-03-18 13:04:38 +00:00
|
|
|
|
|
|
|
files : $(BINDIR)/magimail$(EXESUFFIX) \
|
|
|
|
$(BINDIR)/magistats$(EXESUFFIX) \
|
|
|
|
$(BINDIR)/magilist$(EXESUFFIX) \
|
|
|
|
$(BINDIR)/magigetnode$(EXESUFFIX) \
|
|
|
|
$(BINDIR)/magimaint$(EXESUFFIX) \
|
|
|
|
$(BINDIR)/magiwrite$(EXESUFFIX) \
|
|
|
|
$(BINDIR)/magiexport$(EXESUFFIX) \
|
|
|
|
$(BINDIR)/magilistout$(EXESUFFIX)
|
|
|
|
|
|
|
|
$(BINDIR)/magimail$(EXESUFFIX) : $(CMOBJS) $(SHOBJS) $(NLOBJS) $(MBOBJS) $(OSLIB)
|
2017-10-19 21:27:58 +00:00
|
|
|
$(CC) -o $(BINDIR)/magimail$(EXESUFFIX) $(CMOBJS) $(SHOBJS) $(NLOBJS) $(MBOBJS) $(OSLIB) -lsqlite3 $(SLIBS)
|
2017-03-18 13:04:38 +00:00
|
|
|
$(STRIP) $(BINDIR)/magimail$(EXESUFFIX)
|
|
|
|
|
|
|
|
$(BINDIR)/magistats$(EXESUFFIX) : tools/magistats.c $(SHOBJS) $(OSLIB)
|
|
|
|
$(CC) -o $(BINDIR)/magistats$(EXESUFFIX) tools/magistats.c $(SHOBJS) $(OSLIB)
|
|
|
|
$(STRIP) $(BINDIR)/magistats$(EXESUFFIX)
|
|
|
|
|
|
|
|
$(BINDIR)/magilist$(EXESUFFIX) : tools/magilist.c $(SHOBJS) $(OSLIB)
|
|
|
|
$(CC) -o $(BINDIR)/magilist$(EXESUFFIX) tools/magilist.c $(SHOBJS) $(OSLIB)
|
|
|
|
$(STRIP) $(BINDIR)/magilist$(EXESUFFIX)
|
|
|
|
|
|
|
|
$(BINDIR)/magigetnode$(EXESUFFIX) : tools/magigetnode.c $(SHOBJS) $(CMNLLIB) $(OSLIB)
|
|
|
|
$(CC) -o $(BINDIR)/magigetnode$(EXESUFFIX) tools/magigetnode.c $(SHOBJS) $(CMNLLIB) $(OSLIB)
|
|
|
|
$(STRIP) $(BINDIR)/magigetnode$(EXESUFFIX)
|
|
|
|
|
|
|
|
$(BINDIR)/magimaint$(EXESUFFIX) : tools/magimaint.c $(SHOBJS) $(OSLIB) $(JAMLIB)
|
|
|
|
$(CC) -o $(BINDIR)/magimaint$(EXESUFFIX) tools/magimaint.c $(SHOBJS) $(OSLIB) $(JAMLIB)
|
|
|
|
$(STRIP) $(BINDIR)/magimaint$(EXESUFFIX)
|
|
|
|
|
|
|
|
$(BINDIR)/magiwrite$(EXESUFFIX) : tools/magiwrite.c $(SHOBJS) $(OSLIB)
|
|
|
|
$(CC) -o $(BINDIR)/magiwrite$(EXESUFFIX) tools/magiwrite.c $(SHOBJS) $(OSLIB)
|
|
|
|
$(STRIP) $(BINDIR)/magiwrite$(EXESUFFIX)
|
|
|
|
|
|
|
|
$(BINDIR)/magiexport$(EXESUFFIX) : tools/magiexport.c $(SHOBJS) $(OSLIB)
|
|
|
|
$(CC) -o $(BINDIR)/magiexport$(EXESUFFIX) tools/magiexport.c $(SHOBJS) $(OSLIB)
|
|
|
|
$(STRIP) $(BINDIR)/magiexport$(EXESUFFIX)
|
|
|
|
|
|
|
|
$(BINDIR)/magilistout$(EXESUFFIX) : tools/magilistout.c $(SHOBJS) $(OSLIB)
|
|
|
|
$(CC) -o $(BINDIR)/magilistout$(EXESUFFIX) tools/magilistout.c $(SHOBJS) $(OSLIB)
|
|
|
|
$(STRIP) $(BINDIR)/magilistout$(EXESUFFIX)
|
|
|
|
|
|
|
|
# magimail
|
|
|
|
|
2017-03-22 22:35:00 +00:00
|
|
|
$(OBJDIR)/broadcast.o : magimail/broadcast.c
|
|
|
|
$(CC) -c magimail/broadcast.c -o $(OBJDIR)/broadcast.o
|
|
|
|
|
2017-03-18 13:04:38 +00:00
|
|
|
$(OBJDIR)/magimail.o : magimail/magimail.c
|
|
|
|
$(CC) -c magimail/magimail.c -o $(OBJDIR)/magimail.o
|
|
|
|
|
|
|
|
$(OBJDIR)/logwrite.o : magimail/logwrite.c
|
|
|
|
$(CC) -c magimail/logwrite.c -o $(OBJDIR)/logwrite.o
|
|
|
|
|
|
|
|
$(OBJDIR)/dupe.o : magimail/dupe.c
|
|
|
|
$(CC) -c magimail/dupe.c -o $(OBJDIR)/dupe.o
|
|
|
|
|
|
|
|
$(OBJDIR)/stats.o : magimail/stats.c
|
|
|
|
$(CC) -c magimail/stats.c -o $(OBJDIR)/stats.o
|
|
|
|
|
|
|
|
$(OBJDIR)/misc.o : magimail/misc.c
|
|
|
|
$(CC) -c magimail/misc.c -o $(OBJDIR)/misc.o
|
|
|
|
|
|
|
|
$(OBJDIR)/safedel.o : magimail/safedel.c
|
|
|
|
$(CC) -c magimail/safedel.c -o $(OBJDIR)/safedel.o
|
|
|
|
|
|
|
|
$(OBJDIR)/toss.o : magimail/toss.c
|
|
|
|
$(CC) -c magimail/toss.c -o $(OBJDIR)/toss.o
|
|
|
|
|
|
|
|
$(OBJDIR)/scan.o : magimail/scan.c
|
|
|
|
$(CC) -c magimail/scan.c -o $(OBJDIR)/scan.o
|
|
|
|
|
|
|
|
$(OBJDIR)/pkt.o : magimail/pkt.c
|
|
|
|
$(CC) -c magimail/pkt.c -o $(OBJDIR)/pkt.o
|
|
|
|
|
|
|
|
$(OBJDIR)/memmessage.o : magimail/memmessage.c
|
|
|
|
$(CC) -c magimail/memmessage.c -o $(OBJDIR)/memmessage.o
|
|
|
|
|
|
|
|
$(OBJDIR)/handle.o : magimail/handle.c
|
|
|
|
$(CC) -c magimail/handle.c -o $(OBJDIR)/handle.o
|
|
|
|
|
|
|
|
$(OBJDIR)/node4dpat.o : magimail/node4dpat.c
|
|
|
|
$(CC) -c magimail/node4dpat.c -o $(OBJDIR)/node4dpat.o
|
|
|
|
|
|
|
|
$(OBJDIR)/config.o : magimail/config.c
|
|
|
|
$(CC) -c magimail/config.c -o $(OBJDIR)/config.o
|
|
|
|
|
|
|
|
$(OBJDIR)/outbound.o : magimail/outbound.c
|
|
|
|
$(CC) -c magimail/outbound.c -o $(OBJDIR)/outbound.o
|
|
|
|
|
|
|
|
$(OBJDIR)/areafix.o : magimail/areafix.c
|
|
|
|
$(CC) -c magimail/areafix.c -o $(OBJDIR)/areafix.o
|
|
|
|
|
|
|
|
$(OBJDIR)/filter.o : magimail/filter.c
|
|
|
|
$(CC) -c magimail/filter.c -o $(OBJDIR)/filter.o
|
|
|
|
|
|
|
|
# shared
|
|
|
|
|
|
|
|
$(OBJDIR)/jblist.o : shared/jblist.c
|
|
|
|
$(CC) -c shared/jblist.c -o $(OBJDIR)/jblist.o
|
|
|
|
|
|
|
|
$(OBJDIR)/jbstrcpy.o : shared/jbstrcpy.c
|
|
|
|
$(CC) -c shared/jbstrcpy.c -o $(OBJDIR)/jbstrcpy.o
|
|
|
|
|
|
|
|
$(OBJDIR)/mystrncpy.o : shared/mystrncpy.c
|
|
|
|
$(CC) -c shared/mystrncpy.c -o $(OBJDIR)/mystrncpy.o
|
|
|
|
|
|
|
|
$(OBJDIR)/parseargs.o : shared/parseargs.c
|
|
|
|
$(CC) -c shared/parseargs.c -o $(OBJDIR)/parseargs.o
|
|
|
|
|
|
|
|
$(OBJDIR)/path.o : shared/path.c
|
|
|
|
$(CC) -c shared/path.c -o $(OBJDIR)/path.o
|
|
|
|
|
|
|
|
$(OBJDIR)/node4d.o : shared/node4d.c
|
|
|
|
$(CC) -c shared/node4d.c -o $(OBJDIR)/node4d.o
|
|
|
|
|
|
|
|
$(OBJDIR)/expr.o : shared/expr.c
|
|
|
|
$(CC) -c shared/expr.c -o $(OBJDIR)/expr.o
|
|
|
|
|
|
|
|
# mb
|
|
|
|
|
|
|
|
$(OBJDIR)/mb.o : magimail/mb.c
|
|
|
|
$(CC) -c magimail/mb.c -o $(OBJDIR)/mb.o
|
|
|
|
|
|
|
|
$(OBJDIR)/mb_msg.o : magimail/mb_msg.c
|
|
|
|
$(CC) -c magimail/mb_msg.c -o $(OBJDIR)/mb_msg.o
|
|
|
|
|
|
|
|
$(OBJDIR)/mb_jam.o : magimail/mb_jam.c
|
|
|
|
$(CC) -c magimail/mb_jam.c -o $(OBJDIR)/mb_jam.o
|
|
|
|
|
|
|
|
$(OBJDIR)/mb_sq3.o : magimail/mb_sq3.c
|
|
|
|
$(CC) -c magimail/mb_sq3.c -o $(OBJDIR)/mb_sq3.o
|
|
|
|
|
|
|
|
# nl
|
|
|
|
|
|
|
|
$(OBJDIR)/nl.o : magimail/nl.c
|
|
|
|
$(CC) -c magimail/nl.c -o $(OBJDIR)/nl.o
|
|
|
|
|
|
|
|
$(OBJDIR)/nl_cmnl.o : magimail/nl_cmnl.c
|
|
|
|
$(CC) -c magimail/nl_cmnl.c -o $(OBJDIR)/nl_cmnl.o
|
|
|
|
|
|
|
|
$(OBJDIR)/nl_v7p.o : magimail/nl_v7p.c
|
|
|
|
$(CC) -c magimail/nl_v7p.c -o $(OBJDIR)/nl_v7p.o
|
|
|
|
|
|
|
|
|
|
|
|
# Clean
|
|
|
|
|
|
|
|
clean :
|
|
|
|
$(RM) $(OBJDIR)/*.o
|
|
|
|
|