blob: dbe6b08c334926cd2c6a809451dd5ffab04a9815 (
plain)
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
|
!ifndef FLEXTBUILD
INCPATH=$(INCPATH) -I$(FLEXTPATH)
LIBPATH=$(LIBPATH) -L$(FLEXTPATH)
LIBS=$(LIBS) $(FLEXTNAME).lib
!endif
!ifdef BCCPATH
INCPATH=$(INCPATH) -I$(BCCPATH)\include
LIBPATH=$(LIBPATH) -L$(BCCPATH)\lib
!endif
LIBS=$(LIBS) cw32.lib import32.lib C0D32.OBJ
CFLAGS=$(CFLAGS) -tWD -tWM -w-8004 -w-8027 -w-8057
LDFLAGS=$(LDFLAGS) /C /Tpd
##############################################
# use multithreaded static libraries
!ifdef DEBUG
CFLAGS=$(CFLAGS) -v -D_DEBUG
LDFLAGS=$(LDFLAGS) /v
!else
CFLAGS=$(CFLAGS) $(OFLAGS) -DNDEBUG
!endif
##############################################
!ifdef FLEXTBUILD
OUTNAME=$(FLEXTNAME)
!ifdef SHARED
EXT=dll
!else
EXT=lib
BUILDLIB=1
!endif
!else
OUTNAME=$(NAME)
!endif
##############################################
TARGETPATH=$(OUTPATH)\$(OUTSUB)
TARGET=$(TARGETPATH)\$(OUTNAME).$(EXT)
##############################################
!ifdef PDPATH
$(TARGETPATH)\pd.lib : $(PDPATH)\bin\pd.dll
implib -a $< $**
$(TARGETPATH)\pthreadVC.lib : $(PDPATH)\bin\pthreadVC.dll
implib -a $< $**
PDTARGETS=$(TARGETPATH)\pd.lib $(TARGETPATH)\pthreadVC.lib
!endif
##############################################
# default target
_all_: $(TARGET)
# convert both *.c and *.cpp
OBJSTMP= $(SRCS:.c=.obj)
OBJS= $(OBJSTMP:.objpp=.obj)
$(TARGETPATH):
if not exist $(OUTPATH) mkdir $(OUTPATH) > nul
if not exist $@ mkdir $@ > nul
!ifndef FLEXTBUILD
SETUPFUNCTION=$(NAME)_setup
$(TARGETPATH)\$(NAME).def:
@echo EXPORTS $(SETUPFUNCTION) = _$(SETUPFUNCTION) > $<
# this next line fixes a strange problem with implib - lacking underscore?!
@echo IMPORTS _rtext_retext=PD.rtext_retext >> $<
$(TARGET) :: $(TARGETPATH)\$(NAME).def
!endif
{$(SRCDIR)}.cpp{}.obj:
bcc32 -c $(CFLAGS) $(DEFS) $(INCPATH) -n$(TARGETPATH) $<
{$(SRCDIR)}.c{}.obj:
bcc32 -c $(CFLAGS) $(DEFS) $(INCPATH) -n$(TARGETPATH) $<
$(TARGET) :: $(TARGETPATH) $(PDTARGETS)
$(TARGET) :: $(OBJS)
cd $(TARGETPATH)
!ifdef BUILDLIB
-del $(<F)
tlib "$(<F)" +$(OBJS: = +)
cd ..
!else
ilink32 $(LDFLAGS) $(LIBPATH) -L. $(OBJS) ,$(<F),,$(LIBS),$(NAME).def
!endif
cd ..
##############################################
_clean_:
-del /q $(TARGET) > nul
-cd $(TARGETPATH)
-del /q $(OBJS) > nul
##############################################
$(INSTPATH):
if not exist $@ mkdir $@ > nul
$(FLEXTPATH):
if not exist $@ mkdir $@ > nul
_install_ :: $(INSTPATH) $(FLEXTPATH)
_install_ ::
!ifdef FLEXTBUILD
-copy $(TARGET) $(FLEXTPATH) > nul
@cd $(SRCDIR)
-for %%i in ($(HDRS)) do @copy %%i $(FLEXTPATH) > nul
!else
copy $(TARGET) $(INSTPATH) > nul
!endif
|