blob: 5aa431f645135367725ad343b71a5db6ce1742cb (
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
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
|
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net)
#
# ----- for internal use ----------------------
#
!include config-pd-msvc.txt
NAME=flext
# source files
SOURCE=source
# includes
INCPATH=/I$(PDPATH)\src /I$(SOURCE)
!ifdef MSVCPATH
INCPATH=$(INCPATH) /I$(MSVCPATH)\include
!endif
!ifdef PTHREADS
INCPATH=$(INCPATH) /I$(PTHREADS)
!endif
LDFLAGS=/LIBPATH:$(MSVCPATH)\lib
# compiler definitions and flags
DEFS=/DFLEXT_SYS=2 $(UFLAGS)
CFLAGS=/GX /GD
OFLAGS=/Ox
DFLAGS=/Od /Zi
TARGET=pdwin # appendix to lib name
!ifdef FLEXT_SHARED
DEFS=$(DEFS) /DFLEXT_SHARED /DFLEXT_EXPORTS
EXT=dll
!ifndef _DEBUG
CFLAGS=$(CFLAGS) $(OFLAGS) /MT /LD
OBJPATH=l
!else
CFLAGS=$(CFLAGS) $(DFLAGS) /MTd /LDd
OBJPATH=ld
!endif
LIBS=$(PDPATH)\bin\pd.lib
!ifdef PTHREADS
LIBS=$(LIBS) $(PTHREADS)\pthreadVC.lib
!else
LIBS=$(LIBS) $(PDPATH)\bin\pthreadVC.lib
!endif
!else
EXT=lib
!ifdef FLEXT_THREADS
DEFS=$(DEFS) /DFLEXT_THREADS
!ifndef _DEBUG
CFLAGS=$(CFLAGS) $(OFLAGS) /MT
OBJPATH=t
!else
CFLAGS=$(CFLAGS) $(DFLAGS) /MTd
OBJPATH=td
!endif
!else
!ifndef _DEBUG
CFLAGS=$(CFLAGS) $(OFLAGS) /ML
OBJPATH=s
!else
CFLAGS=$(CFLAGS) $(DFLAGS) /MLd
OBJPATH=sd
!endif
!endif # FLEXT_THREADS
!endif # FLEXT_SHARED
# the rest can stay untouched
# ----------------------------------------------
# all the source files from the package
!include make-files.txt
!ifdef SNDOBJ
SRCS=$(SRCS) $(SRCS_SNDOBJ)
HDRS=$(HDRS) $(HDRS_SNDOBJ)
INCPATH=$(INCPATH) /I$(SNDOBJ)\include
LIBS=$(LIBS) $(SNDOBJ)\lib\sndobj.lib
!endif
!ifdef STK
SRCS=$(SRCS) $(SRCS_STK)
HDRS=$(HDRS) $(HDRS_STK)
INCPATH=$(INCPATH) /I$(STK)\include
LIBS=$(LIBS) $(STK)\lib\stk.lib
!endif
#default target
all: $(OUTPATH)\$(NAME)-$(TARGET).$(EXT)
# remove build
clean:
-cd $(OUTPATH)
-del /s /q $(OBJPATH) > nul
-rmdir $(OBJPATH)
-cd ..
-del /q $(OUTPATH)\$(NAME)-$(TARGET).$(EXT) > nul
-rmdir $(OUTPATH)
# -----------------------------------------------
OBJS= $(SRCS:.cpp=.obj)
{$(SOURCE)\}.cpp.obj:
@-if not exist $(OUTPATH) mkdir $(OUTPATH)
@cd $(OUTPATH)
@-if not exist $(OBJPATH) mkdir $(OBJPATH)
@cd ..
cl /c $(CFLAGS) $(DEFS) $(INCPATH) /Fo$(OUTPATH)\$(OBJPATH)\$(@F) $<
$(OUTPATH)\$(NAME)-$(TARGET).lib: $(OBJS)
@cd $(OUTPATH)\$(OBJPATH)
lib /OUT:..\$(NAME)-$(TARGET).lib $(OBJS)
@cd ..\..
!ifdef INSTDIR
@-if not exist $(OBJPATH) mkdir $(INSTDIR)
copy $(OUTPATH)\$(NAME)-$(TARGET).lib $(INSTDIR) > nul
copy $(SOURCE)\*.h $(INSTDIR) > nul
!endif
$(OUTPATH)\$(NAME)-$(TARGET).dll: $(OBJS)
@cd $(OUTPATH)\$(OBJPATH)
link /DLL /NOLOGO $(LDFLAGS) /OUT:..\$(NAME)-$(TARGET).dll $(LIBS) $(OBJS)
@cd ..\..
!ifdef INSTDIR
@-if not exist $(OBJPATH) mkdir $(INSTDIR)
copy $(OUTPATH)\$(NAME)-$(TARGET).dll $(INSTDIR) > nul
copy $(SOURCE)\*.h $(INSTDIR) > nul
!endif
|