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

# Make 'include file' defining targets for Synchronet project

5
# LIBODIR, EXEODIR, LIBFILE, EXEFILE, and DELETE must be pre-defined
rswindell's avatar
rswindell committed
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
SBBS		= $(LIBODIR)/$(LIBPREFIX)sbbs$(SOFILE)
FTPSRVR		= $(LIBODIR)/$(LIBPREFIX)ftpsrvr$(SOFILE)
WEBSRVR		= $(LIBODIR)/$(LIBPREFIX)websrvr$(SOFILE)
MAILSRVR	= $(LIBODIR)/$(LIBPREFIX)mailsrvr$(SOFILE)
SERVICES	= $(LIBODIR)/$(LIBPREFIX)services$(SOFILE)
SBBSCON		= $(EXEODIR)/sbbs$(EXEFILE)
SBBSMONO	= $(EXEODIR)/sbbsmono$(EXEFILE)
JSEXEC		= $(EXEODIR)/jsexec$(EXEFILE)
JSDOOR		= $(EXEODIR)/jsdoor$(EXEFILE)
NODE		= $(EXEODIR)/node$(EXEFILE)
BAJA		= $(EXEODIR)/baja$(EXEFILE)
UNBAJA		= $(EXEODIR)/unbaja$(EXEFILE)
FIXSMB		= $(EXEODIR)/fixsmb$(EXEFILE)
CHKSMB		= $(EXEODIR)/chksmb$(EXEFILE)
SMBUTIL		= $(EXEODIR)/smbutil$(EXEFILE)
SBBSECHO	= $(EXEODIR)/sbbsecho$(EXEFILE)
ECHOCFG		= $(EXEODIR)/echocfg$(EXEFILE)
ADDFILES	= $(EXEODIR)/addfiles$(EXEFILE)
FILELIST	= $(EXEODIR)/filelist$(EXEFILE)
MAKEUSER	= $(EXEODIR)/makeuser$(EXEFILE)
ANS2ASC		= $(EXEODIR)/ans2asc$(EXEFILE)
ASC2ANS		= $(EXEODIR)/asc2ans$(EXEFILE)
SEXYZ		= $(EXEODIR)/sexyz$(EXEFILE)
QWKNODES	= $(EXEODIR)/qwknodes$(EXEFILE)
SLOG		= $(EXEODIR)/slog$(EXEFILE)
ALLUSERS	= $(EXEODIR)/allusers$(EXEFILE)
DELFILES	= $(EXEODIR)/delfiles$(EXEFILE)
DUPEFIND	= $(EXEODIR)/dupefind$(EXEFILE)
SMBACTIV	= $(EXEODIR)/smbactiv$(EXEFILE)
DSTSEDIT	= $(EXEODIR)/dstsedit$(EXEFILE)
READSAUCE	= $(EXEODIR)/readsauce$(EXEFILE)
SHOWSTAT	= $(EXEODIR)/showstat$(EXEFILE)
PKTDUMP		= $(EXEODIR)/pktdump$(EXEFILE)
FMSGDUMP	= $(EXEODIR)/fmsgdump$(EXEFILE)
UPGRADE_TO_V319 = $(EXEODIR)/upgrade_to_v319$(EXEFILE)
rswindell's avatar
rswindell committed
42

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

Rob Swindell's avatar
Rob Swindell committed
53
54
55
GIT_INFO	= git_hash.h git_branch.h

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

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

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

66
67
gtkutils: gtkmonitor gtkchat gtkuseredit gtkuserlist

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

72
73
74
mono:	xpdev-mt smblib \
		$(MTOBJODIR) $(EXEODIR) \
		$(SBBSMONO)
75

76
77
.PHONY: scfg
scfg:
78
	$(MAKE) -C scfg $(MAKEFLAGS)
79
80

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

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

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
.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)
103

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

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

118
119
120
121
122
.PHONY: FORCE
FORCE:

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

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

133
134
135
ifeq ($(os),linux)
.PHONY: setcap
setcap: all
136
	sudo $(whereis -b setcap | cut -d" " -f2) 'cap_net_bind_service=+ep' $(EXEODIR)/sbbs
137
138
endif

139
140
141
.PHONY: sexyz
sexyz:	$(SEXYZ)

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

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