-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
67 lines (51 loc) · 1.46 KB
/
Makefile
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
CC=gcc
OPT_FLAGS = -O2 -Wall
OPT_LIBS = -lpthread
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/man/man1
SOLARIS_LIBS = -lsocket -lnsl
QNX_LIBS = -lsocket
PEDANTIC_FLAGS = -g -O2 -Wall -pedantic
DEV_FLAGS = -g -O2 -Wall
all: opt
solaris: solaris-opt
clean:
-rm -rf newspost newspost.exe core *~
cd base ; $(MAKE) clean
cd ui ; $(MAKE) clean
cd enc ; $(MAKE) clean
cd cksfv ; $(MAKE) clean
cd parchive ; $(MAKE) clean
main:
cd base ; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)"
cd ui ; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)"
cd enc ; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)"
cd cksfv ; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)"
cd parchive ; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)"
$(CC) -o newspost $(LIBS) base/*.o ui/*.o enc/*.o cksfv/*.o \
parchive/*.o
dev:
$(MAKE) main CFLAGS="$(DEV_FLAGS)" LIBS="$(OPT_LIBS)"
pedantic:
$(MAKE) main CFLAGS="$(PEDANTIC_FLAGS)" LIBS=""
opt:
$(MAKE) main CFLAGS="$(OPT_FLAGS)" LIBS="$(OPT_LIBS)"
-strip newspost
solaris-dev:
$(MAKE) main CFLAGS="$(DEV_FLAGS)" LIBS="$(SOLARIS_LIBS)"
solaris-pedantic:
$(MAKE) main CFLAGS="$(PEDANTIC_FLAGS)" LIBS="$(SOLARIS_LIBS)"
solaris-opt:
$(MAKE) main CFLAGS="$(OPT_FLAGS)" LIBS="$(SOLARIS_LIBS)"
-strip newspost
qnx:
$(MAKE) main CFLAGS="$(OPT_FLAGS)" LIBS="$(QNX_LIBS)"
-strip newspost
install:
sh mkinstalldirs -m 755 $(BINDIR)
cp newspost $(BINDIR)
chmod 755 $(BINDIR)/newspost
sh mkinstalldirs -m 755 $(MANDIR)
cp man/man1/newspost.1 $(MANDIR)
chmod 644 $(MANDIR)/newspost.1