1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
#--------------------------
# MultiMail Makefile (top)
#--------------------------
msrc = mmail
isrc = interfac
# General options (passed to mmail/Makefile and interfac/Makefile). POST
# is for any post-processing that needs doing.
ifeq ($(DEBUG),Y)
CXXFLAGS += -g -Wall -pedantic
else
CXXFLAGS += -O2 -Wall -pedantic
POST = strip mm$(E)
endif
# PREFIX is the base directory under which to install the binary and man
# page; generally either /usr/local or /usr (or perhaps /opt...).
PREFIX = $(DESTDIR)/usr
#--------------------------------------------------------------
# Defaults are for the standard curses setup:
# CURS_DIR specifies the directory with curses.h, if it's not in the
# include path. LIBS lists any "extra" libraries that need to be linked
# in, including the curses library. RM is the Delete command ("rm" or
# "del", as appropriate), and SEP is the separator for multi-statement
# lines... some systems require ";", while others need "&&".
ifeq ($(OS),Windows_NT)
CURS_DIR = /pdcurses
LIBS = $(CURS_DIR)/wincon/pdcurses.a
RM = del
SEP = &&
E = .exe
else
CURS_DIR = .
LIBS = -lcurses
RM = rm -f
SEP = ;
E =
endif
#--------------------------------------------------------------
# With PDCurses for X11:
ifeq ($(SYS),X11)
CURS_DIR = $(shell xcurses-config --cflags | cut -c 3-)
LIBS = $(shell xcurses-config --libs)
endif
#--------------------------------------------------------------
# With PDCurses for SDL:
ifeq ($(SYS),SDL)
CURS_DIR = /Users/wmcbrine/pdsrc/PDCurses
LIBS = $(CURS_DIR)/sdl2/pdcurses.a $(shell sdl2-config --libs)
endif
#--------------------------------------------------------------
# For DJGPP:
ifeq ($(SYS),DOS)
CURS_DIR = /pdcurses
LIBS = $(CURS_DIR)/dos/pdcurses.a
RM = del
SEP = ;
E = .exe
POST = strip mm.exe; exe2coff mm.exe; copy /b \
c:\djgpp\bin\cwsdstub.exe+mm mm.exe; del mm
endif
HELPDIR = $(PREFIX)/share/man1
O = o
.SUFFIXES: .cc
.PHONY: clean dep install
all: mm$(E)
MOBJS = misc.o resource.o mmail.o driverl.o filelist.o area.o letter.o \
read.o compress.o pktbase.o bw.o qwk.o omen.o soup.o opx.o
IOBJS = mmcolor.o mysystem.o isoconv.o basic.o interfac.o packet.o \
arealist.o letterl.o letterw.o lettpost.o ansiview.o addrbook.o \
tagline.o help.o main.o
$(MOBJS) : %.o: $(msrc)/%.cc
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $<
$(IOBJS) : %.o: $(isrc)/%.cc
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -I$(CURS_DIR) -c $<
mm$(E): $(MOBJS) $(IOBJS)
$(CXX) -o mm$(E) $(MOBJS) $(IOBJS) $(LDFLAGS) $(LIBS)
$(POST)
dep:
$(CXX) -MM $(msrc)/*.cc | sed s/"\.o"/"\.\$$(O)"/ > depend
$(CXX) -I$(CURS_DIR) -MM $(isrc)/*.cc | sed s/"\.o"/"\.\$$(O)"/ >> depend
clean:
$(RM) *.o
$(RM) mm$(E)
install::
install -d $(PREFIX)/bin $(HELPDIR)
install -c $(INSTALL_OPTS) mm $(PREFIX)/bin
install -c -m 644 mm.1 $(HELPDIR)
$(RM) $(HELPDIR)/mmail.1
ln $(HELPDIR)/mm.1 $(HELPDIR)/mmail.1
include depend
|