-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMAKEFILE.MAK
159 lines (135 loc) · 4.27 KB
/
MAKEFILE.MAK
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# BHZ Skeleton MBBS v6.x module makefile
# Mark Seelye (bhz) (c)2023
# burninghorizon.com, bhz.co
#
# Can be easily customized to be used for new projects:
# Use NEWMOD.BAT to create a new instance of a module from this.
# DEVID is your 3 character dev id. (Ex: BHZ)
# MODID is your module's 1-5 character module id (Ex: BLURP)
# (Tip: These 2 combined should be <= 8 chars!)
# Use a BBS path that points to your MBBS install
# NEWMOD.BAT for details.
#
# As you develop your module, remember to:
# Customize the purge target for clean!
# Customize your DLL libs as needed, (update LNK file too!)
# Modify/Configure your MDF file!
# Modify/Configure your LNK file!
# Modify/Configure your BCR file(s)!
#
# Assumptions:
# MBBS 6.x installed at $(BBS)
# MBBS 6.x dev files/tools installed at $(BBS)\SRC
# Btrieve.exe and butil.exe in path
# BBSMSX.exe in classpath
# BorlandC 3.1 installed
# Pharlap/phobj installed
#
# Notes:
# MAKEFILE.INC, LNK file, MDF file, MODDEFS.H will be autogenerated by NEWMOD.BAT
# VIR target need to first run c:\bbsv6\btrieve.exe
# MAKE v3.6 doesn't have .phony, so there is a phony kludge here
# @ prefix seems to be ignored, using > nul
!include "MAKEFILE.INC"
!include "MAKEMSGS.INC"
.autodepend
.nosilent
.noignore
.path.dll=$(BBS)
.path.obj=$(BBS)\PHOBJ
all : start warp mdf database module unwarp done status
help:
@cls
@type mkhelp.txt
# mdf: Deploy module def file
mdf: PHONY.MDF
# module: build module dll
module: $(MODNAM).DLL
# messages: build .h/.mcv files (bbsmsx)
messages : $(MODNAM).H
# database: build empty btrieve database to specs in BCR file, aka VIR file
database : $(MODNAM).VIR
$(MODNAM).DLL : $(MODNAM).OBJ $(BBS)\DLIB\GALIMP.LIB $(PHARLIB)\PHAPI.LIB
$(ECHO) $(DLL_START)
# ltdll $(MODNAM)
$(Q)TLINK /L$(PHARLIB);$(BBS)\DLIB @$(MODNAM).LNK$(QE)
# Build OBJ file
$(MODNAM).OBJ: $(MODMAIN).C $(MODMAIN).H $(MODNAM).H MODDEFS.H
$(ECHO) $(OBJ_START)
# ctdll $(MODMAIN)
$(Q)bcc -o$(BBS)\phobj\$(MODNAM).OBJ -I$(BBSSRC) -I$(PHARINC) @$(BBSSRC)\makdll.cfg $(MODMAIN)$(QE)
$(MODNAM).H: PHONY.MSG
$(ECHO) $(MNH_START)
$(Q)$(BBS)\bbsmsx $(MODNAM)$(QE)
@copy $(MODNAM).MCV $(BBS)\$(MODNAM).MCV > nul
# Build MSG/Deploy MSG, MDF, H files (PHONY kludge)
PHONY.MSG: $(MODNAM).MSG
$(ECHO) $(MSG_START)
@copy $(MODNAM).MSG PHONY.MSG > nul
$(Q)copy $(MODNAM).MSG $(BBS)\$(MODNAM).MSG$(QE)
@touch PHONY.MSG > nul
# Deploy MDF file if it has changed (PHONY kludge)
PHONY.MDF: $(MODNAM).MDF
$(ECHO) $(MDF_START)
@copy $(MODNAM).MDF PHONY.MDF > nul
$(Q)copy $(MODNAM).MDF $(BBS)\$(MODNAM).MDF$(QE)
@touch PHONY.MDF > nul
# Build database VIR/DAT files
$(MODNAM).VIR : $(MODNAM).BCR
$(ECHO) $(BT_START)
@-$(BBS)\btrieve.exe > nul
$(ECHO) $(VIR_START)
$(Q)butil -create $(MODNAM).VIR $(MODNAM).BCR$(QE)
@copy $(MODNAM).VIR $(BBS)\$(MODNAM).VIR > nul
# Build all and copy distributables to ./DIST/
dist: all
@cls
$(ECHO) $(DIST_START)
@echo.
@mkdir DIST > nul
@copy $(BBS)\$(MODNAM).DLL DIST\$(MODNAM).DLL > nul
@copy $(BBS)\$(MODNAM).MCV DIST\$(MODNAM).MCV > nul
@copy $(BBS)\$(MODNAM).MDF DIST\$(MODNAM).MDF > nul
@copy $(BBS)\$(MODNAM).MSG DIST\$(MODNAM).MSG > nul
@copy $(BBS)\$(MODNAM).VIR DIST\$(MODNAM).VIR > nul
$(DIR) DIST\$(MODNAM).*
# Friendly start message
start:
$(ECHO) $(ALL_START)
# Friendly done message, show status
done:
$(ECHO) $(ALL_DONE)
# Clean, show status
clean : cls purgebbs status purgemodsrc
# Just cleans local dir
tidy : cls purgemodsrc
cls:
cls
purgebbs:
@echo.
$(ECHO) $(CLEAN_BBS_START)
@del $(BBS)\$(MODNAM).VIR > nul
@del $(BBS)\$(MODNAM).DLL > nul
@del $(BBS)\$(MODNAM).H > nul
@del $(BBS)\$(MODNAM).MCV > nul
@del $(BBS)\$(MODNAM).MDF > nul
@del $(BBS)\$(MODNAM).MSG > nul
@del $(BBS)\PHOBJ\$(MODNAM).OBJ > nul
purgemodsrc:
@echo.
$(ECHO) $(TIDY_SRC_START)
$(Q)@cd$(QE)
@del PHONY.* > nul
@del $(MODNAM).MAP > nul
@del $(MODNAM).MCV > nul
@del $(MODNAM).VIR > nul
@del $(MODNAM).H > nul
$(DIR) /w
status:
$(DIR) /w $(BBS)\$(DEVID)$(MODID)*.*
#
# Convenience Stuff
#
!include "BATS.INC"
!include "DSBXWARP.INC"