targets.mk 5.1 KB
Newer Older
rswindell's avatar
rswindell committed
1
2
3
4
# targets.mk

# Make 'include file' defining targets for Synchronet project

5
# $Id: targets.mk,v 1.54 2020/05/14 20:32:04 rswindell Exp $
rswindell's avatar
rswindell committed
6

7
8
9
10
11
12
13
14
15
16
# LIBODIR, EXEODIR, DIRSEP, LIBFILE, EXEFILE, and DELETE must be pre-defined

SBBS		= $(LIBODIR)$(DIRSEP)$(LIBPREFIX)sbbs$(SOFILE)
FTPSRVR		= $(LIBODIR)$(DIRSEP)$(LIBPREFIX)ftpsrvr$(SOFILE)
WEBSRVR		= $(LIBODIR)$(DIRSEP)$(LIBPREFIX)websrvr$(SOFILE)
MAILSRVR	= $(LIBODIR)$(DIRSEP)$(LIBPREFIX)mailsrvr$(SOFILE)
SERVICES	= $(LIBODIR)$(DIRSEP)$(LIBPREFIX)services$(SOFILE)
SBBSCON		= $(EXEODIR)$(DIRSEP)sbbs$(EXEFILE)
SBBSMONO	= $(EXEODIR)$(DIRSEP)sbbsmono$(EXEFILE)
JSEXEC		= $(EXEODIR)$(DIRSEP)jsexec$(EXEFILE)
17
JSDOOR		= $(EXEODIR)$(DIRSEP)jsdoor$(EXEFILE)
18
19
NODE		= $(EXEODIR)$(DIRSEP)node$(EXEFILE)
BAJA		= $(EXEODIR)$(DIRSEP)baja$(EXEFILE)
20
UNBAJA		= $(EXEODIR)$(DIRSEP)unbaja$(EXEFILE)
21
22
23
24
25
26
27
28
29
30
FIXSMB		= $(EXEODIR)$(DIRSEP)fixsmb$(EXEFILE)
CHKSMB		= $(EXEODIR)$(DIRSEP)chksmb$(EXEFILE)
SMBUTIL		= $(EXEODIR)$(DIRSEP)smbutil$(EXEFILE)
SBBSECHO	= $(EXEODIR)$(DIRSEP)sbbsecho$(EXEFILE)
ECHOCFG		= $(EXEODIR)$(DIRSEP)echocfg$(EXEFILE)
ADDFILES	= $(EXEODIR)$(DIRSEP)addfiles$(EXEFILE)
FILELIST	= $(EXEODIR)$(DIRSEP)filelist$(EXEFILE)
MAKEUSER	= $(EXEODIR)$(DIRSEP)makeuser$(EXEFILE)
ANS2ASC		= $(EXEODIR)$(DIRSEP)ans2asc$(EXEFILE)
ASC2ANS		= $(EXEODIR)$(DIRSEP)asc2ans$(EXEFILE)
deuce's avatar
deuce committed
31
SEXYZ		= $(EXEODIR)$(DIRSEP)sexyz$(EXEFILE)
deuce's avatar
deuce committed
32
QWKNODES	= $(EXEODIR)$(DIRSEP)qwknodes$(EXEFILE)
deuce's avatar
deuce committed
33
SLOG		= $(EXEODIR)$(DIRSEP)slog$(EXEFILE)
34
ALLUSERS	= $(EXEODIR)$(DIRSEP)allusers$(EXEFILE)
deuce's avatar
deuce committed
35
DELFILES	= $(EXEODIR)$(DIRSEP)delfiles$(EXEFILE)
deuce's avatar
deuce committed
36
DUPEFIND	= $(EXEODIR)$(DIRSEP)dupefind$(EXEFILE)
deuce's avatar
deuce committed
37
SMBACTIV	= $(EXEODIR)$(DIRSEP)smbactiv$(EXEFILE)
38
DSTSEDIT	= $(EXEODIR)$(DIRSEP)dstsedit$(EXEFILE)
deuce's avatar
deuce committed
39
READSAUCE	= $(EXEODIR)$(DIRSEP)readsauce$(EXEFILE)
40
SHOWSTAT	= $(EXEODIR)$(DIRSEP)showstat$(EXEFILE)
41
42
PKTDUMP		= $(EXEODIR)$(DIRSEP)pktdump$(EXEFILE)
FMSGDUMP	= $(EXEODIR)$(DIRSEP)fmsgdump$(EXEFILE)
43
UPGRADE_TO_V319 = $(EXEODIR)$(DIRSEP)upgrade_to_v319$(EXEFILE)
rswindell's avatar
rswindell committed
44

45
46
47
48
49
50
UTILS		= $(FIXSMB) $(CHKSMB) \
			  $(SMBUTIL) $(BAJA) $(NODE) \
			  $(SBBSECHO) $(ECHOCFG) \
			  $(ADDFILES) $(FILELIST) $(MAKEUSER) \
			  $(ANS2ASC) $(ASC2ANS)  $(UNBAJA) \
			  $(QWKNODES) $(SLOG) $(ALLUSERS) \
51
			  $(DELFILES) $(DUPEFIND) $(SMBACTIV) \
52
			  $(SEXYZ) $(DSTSEDIT) $(READSAUCE) $(SHOWSTAT) \
53
			  $(PKTDUMP) $(FMSGDUMP) $(UPGRADE_TO_V319)
rswindell's avatar
rswindell committed
54

Rob Swindell's avatar
Rob Swindell committed
55
56
57
GIT_INFO	= git_hash.h git_branch.h

all:	$(GIT_INFO) dlls utils console scfg uedit umonitor
58

deuce's avatar
deuce committed
59
console:	$(JS_DEPS) xpdev-mt smblib \
60
61
		$(MTOBJODIR) $(LIBODIR) $(EXEODIR) \
		dlls \
62
		$(SBBSCON) $(JSEXEC)
rswindell's avatar
rswindell committed
63

64
65
66
67
utils:	smblib xpdev-mt xpdev ciolib-mt uifc-mt \
		$(LIBODIR) $(OBJODIR) $(MTOBJODIR) $(EXEODIR) \
		$(UTILS)

68
69
gtkutils: gtkmonitor gtkchat gtkuseredit gtkuserlist

deuce's avatar
deuce committed
70
dlls:	$(JS_DEPS) smblib xpdev-mt \
71
		$(MTOBJODIR) $(LIBODIR) \
rswindell's avatar
rswindell committed
72
73
		$(SBBS) $(FTPSRVR) $(MAILSRVR) $(SERVICES)

74
75
76
mono:	xpdev-mt smblib \
		$(MTOBJODIR) $(EXEODIR) \
		$(SBBSMONO)
77

78
79
.PHONY: scfg
scfg:
80
	$(MAKE) -C scfg $(MAKEFLAGS)
81
82

.PHONY: uedit
Deucе's avatar
Deucе committed
83
uedit: uifc-mt
84
	$(MAKE) -C uedit $(MAKEFLAGS)
85
86

.PHONY: umonitor
Deucе's avatar
Deucе committed
87
umonitor: uifc-mt
88
	$(MAKE) -C umonitor $(MAKEFLAGS)
89

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
.PHONY: gtkmonitor
gtkmonitor:
	$(MAKE) -C gtkmonitor $(MAKEFLAGS)

.PHONY: gtkchat
gtkchat:
	$(MAKE) -C gtkchat $(MAKEFLAGS)

.PHONY: gtkuseredit
gtkuseredit:
	$(MAKE) -C gtkuseredit $(MAKEFLAGS)

.PHONY: gtkuserlist
gtkuserlist:
	$(MAKE) -C gtkuserlist $(MAKEFLAGS)
105

106
107
ifdef SBBSEXEC
.PHONY: install
108
install: all
109
110
	install $(EXEODIR)/* $(SBBSEXEC)
	install $(LIBODIR)/* $(SBBSEXEC)
111
	install */$(EXEODIR)/* $(SBBSEXEC)
112
113

.PHONY: symlinks
114
symlinks: all
115
116
	ln -sfr $(EXEODIR)/* $(SBBSEXEC)
	ln -sfr $(LIBODIR)/* $(SBBSEXEC)
117
	ln -sfr */$(EXEODIR)/* $(SBBSEXEC)
118
119
endif

120
121
122
123
124
.PHONY: FORCE
FORCE:

ifneq ($(GIT), NO)
git_hash.h: FORCE ../../.git
125
126
127
	$(QUIET)echo '#define GIT_HASH "'`git log -1 HEAD --format=%h`\" > $@.tmp
	$(QUIET)diff $@.tmp $@ || cp $@.tmp $@
	$(QUIET)rm -f $@.tmp
128
129

git_branch.h: FORCE ../../.git
130
131
132
	$(QUIET)echo '#define GIT_BRANCH "'`git rev-parse --abbrev-ref HEAD`\" > $@.tmp
	$(QUIET)diff $@.tmp $@ || cp $@.tmp $@
	$(QUIET)rm -f $@.tmp
133
134
endif

135
136
137
138
139
140
ifeq ($(os),linux)
.PHONY: setcap
setcap: all
	sudo setcap 'cap_net_bind_service=+ep' $(EXEODIR)/sbbs
endif

141
142
143
.PHONY: sexyz
sexyz:	$(SEXYZ)

144
.PHONY: jsdoor
145
jsdoor: $(GIT_INFO) $(JS_DEPS) $(CRYPT_DEPS) $(XPDEV-MT_LIB) $(SMBLIB) $(UIFCLIB-MT) $(CIOLIB-MT) $(JSDOOR)
146
147

# Library dependencies
148
$(SBBS):
149
$(FTPSRVR): $(SMBLIB) 
150
151
152
153
154
155
$(WEBSRVR):
$(MAILSRVR):
$(SERVICES): 
$(SBBSCON): $(XPDEV-MT_LIB) $(SMBLIB)
$(SBBSMONO): $(XPDEV-MT_LIB) $(SMBLIB)
$(JSEXEC): $(XPDEV-MT_LIB) $(SMBLIB)
156
$(JSDOOR): $(XPDEV-MT_LIB)
157
158
$(NODE): $(XPDEV_LIB)
$(BAJA): $(XPDEV_LIB) $(SMBLIB)
deuce's avatar
deuce committed
159
$(UNBAJA): $(XPDEV_LIB)
160
161
162
163
164
$(FIXSMB): $(XPDEV_LIB) $(SMBLIB)
$(CHKSMB): $(XPDEV_LIB) $(SMBLIB)
$(SMBUTIL): $(XPDEV_LIB) $(SMBLIB)
$(SBBSECHO): $(XPDEV_LIB) $(SMBLIB)
$(ECHOCFG): $(XPDEV-MT_LIB) $(SMBLIB) $(UIFCLIB-MT) $(CIOLIB-MT)
165
166
$(ADDFILES): $(XPDEV_LIB) $(SMBLIB)
$(FILELIST): $(XPDEV_LIB) $(SMBLIB)
167
168
169
$(MAKEUSER): $(XPDEV_LIB)
$(ANS2ASC):
$(ASC2ANS):
deuce's avatar
deuce committed
170
$(SEXYZ): $(XPDEV-MT_LIB) $(SMBLIB)
deuce's avatar
deuce committed
171
$(QWKNODES): $(XPDEV_LIB)
deuce's avatar
deuce committed
172
$(SLOG): $(XPDEV_LIB)
173
$(ALLUSERS): $(XPDEV_LIB)
174
$(DELFILES): $(XPDEV_LIB) $(SMBLIB)
deuce's avatar
deuce committed
175
$(DUPEFIND): $(XPDEV_LIB) $(SMBLIB)
deuce's avatar
deuce committed
176
$(SMBACTIV): $(XPDEV_LIB) $(SMBLIB)
177
$(DSTSEDIT): $(XPDEV_LIB)
deuce's avatar
deuce committed
178
$(READSAUCE): $(XPDEV_LIB)
179
$(SHOWSTAT): $(XPDEV_LIB)
180
181
$(UPGRADE_TO_V319): $(XPDEV_LIB) $(SMBLIB)