aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/pool/makefile.pd-bcc
blob: e12abde0fe45c44d2890f0cd71e7d845c0115d4c (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
# pool - hierarchical storage object for PD and Max/MSP
# Copyright (C) 2002-2004 Thomas Grill
#
# Makefile for BorlandC++ 
#
# usage: make -f makefile.pd-bcc
#
# ---------------------------------------------

!include config-pd-bcc.txt

# all the source files from the package
!include make-files.txt

SETUPFUNCTION=$(NAME)_setup

# flext stuff
TARGET=pdwin

# includes, libs
INCPATH=-I$(BCCPATH)\include -I$(PDPATH)\src -I$(FLEXTPATH)
LIBPATH=-L$(BCCPATH)\lib -L$(PDPATH)\lib 
LIBS=cw32.lib import32.lib C0D32.OBJ 

# compiler definitions and flags
DEFS=-DFLEXT_SYS=2 
CFLAGS=-tWD $(UFLAGS)


# the rest can stay untouched
# ----------------------------------------------

# default target
all: $(OUTPATH)\$(NAME).dll

# remove build
clean:
	-del /s /q $(OUTPATH) > nul
	rmdir $(OUTPATH)


install:
	cp $(OUTPATH)\$(NAME).dll $(INSTPATH)
	
# ----------------------------------------------

OBJS= $(SRCS:.cpp=.obj)

#.PATH.OBJ=$(OUTPATH)

#$(SRCS): $(HDRS)
#	-touch $<

{$(SRCDIR)}.cpp.obj:
	bcc32 -c $(CFLAGS) $(DEFS) $(INCPATH) -n$(OUTPATH) $<

$(OUTPATH):
	-@if not exist $< mkdir $<

$(OUTPATH)\pd.lib: $(PDPATH)\bin\pd.dll 
	implib -a $< $**

$(OUTPATH)\$(NAME).def:
	@echo EXPORTS $(SETUPFUNCTION) = _$(SETUPFUNCTION) > $<
# this next line fixes a strange problem with implib - lacking underscore?!
	@echo IMPORTS _rtext_retext=PD.rtext_retext >> $<

$(OUTPATH)\$(NAME).dll :: $(OUTPATH) $(OUTPATH)\$(NAME).def $(OUTPATH)\pd.lib 

$(OUTPATH)\$(NAME).dll :: $(OBJS) 
	cd $(OUTPATH)
	ilink32 -C -Tpd $(LIBPATH) $** ,..\$<,,$(LIBS) pd.lib $(FLEXTPATH)\flext-$(TARGET).lib ,$(NAME).def
	cd ..
!if $d(INSTPATH) && "$(INSTPATH)" != ""
	@-if not exist $(INSTPATH) mkdir $(INSTPATH)
	copy $< $(INSTPATH) >nul
!endif