aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/buildsys/win/bmake-bcc-flext.inc
blob: 8dfb224ec328e34e2eaadccc6c1dbe295313bc6d (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
# build class specific settings

##############################################

# default target
_build_: $(TARGET) 

$(OUTPATH):
	if not exist $@ mkdir $@ > nul

$(TARGETPATH): $(OUTPATH)
	if not exist $@ mkdir $@ > nul

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

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


$(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


$(TARGET) :: $(TARGETPATH) $(PDTARGETS)

$(TARGET) :: $(OBJS)
	@cd $(TARGETPATH)
!ifdef SHARED
	ilink32 $(LDFLAGS) $(LIBPATH) -L. $(OBJS) ,$(<F),,$(LIBS)
	implib -a $(<B).lib $(<F)
!else
	-del $(<F)
	tlib "$(<F)" +$(OBJS: = +)
!endif
	@cd ..\..

##############################################

_clean_:
	-del /q $(TARGETPATH)\*.* > nul
	-rmdir /q $(TARGETPATH) > nul

##############################################

!ifdef SHARED
FLEXTLIBINST=$(FLEXTSHLIB)
!else
FLEXTLIBINST=$(FLEXTLIB)
!endif

_install_:
	@if not exist $@ mkdir $(FLEXTINC) > nul
	@if not exist $@ mkdir $(FLEXTLIB) > nul
	@if not exist $@ mkdir $(FLEXTLIBINST) > nul

	copy $(TARGET) $(FLEXTLIBINST) > nul
!ifdef SHARED
# copy import library
	copy $(TARGET:.dll=.lib) $(FLEXTLIB) > nul	
!endif
# copy headers
	for %%i in ($(HDRS)) do @copy $(SRCDIR)\%%i $(FLEXTINC) > nul	
# copy import libraries
	for %%i in ($(PDTARGETS)) do @copy %%i $(FLEXTLIB) > nul