Makefile 82.9 KB
Newer Older
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

#==============================================================================#
#
# Centralized build system for "externals".  
#
# see README for instructions  <hans@at.or.at>
# http://puredata.org/docs/developer/build
#
#==============================================================================#

CWD := $(shell pwd)

# these are setup to be overridden by the packages/Makefile
cvs_root_dir := $(shell cd $(CWD)/.. && pwd)
DESTDIR = $(CWD)/build/
BUILDLAYOUT_DIR = $(cvs_root_dir)/packages

# turn on weak linking and dlopen support
export MACOSX_DEPLOYMENT_TARGET = 10.3

# default target
default: all

.SUFFIXES: .$(EXTENSION) .$(SHARED_LIB)


include $(BUILDLAYOUT_DIR)/Makefile.buildlayout


# these are sent to all of the various Makefiles so that they all copy their
# output to the same directory tree
DEST_PATHS = BUILDLAYOUT_DIR=$(BUILDLAYOUT_DIR) \
				cvs_root_dir=$(cvs_root_dir) \
				DESTDIR=$(DESTDIR) \
				prefix=$(prefix)

#==============================================================================#
#
# COMPILE TARGETS
#
#==============================================================================#

# this variable is to support old "win" directories, rather than "windows"
BUILDSRC_OS_NAME = $(OS_NAME)

CFLAGS = -DPD -I$(pd_src)/src -Wall -W $(DEBUG_CFLAGS) -I$(gem_src)/src
LDFLAGS =  
LIBS = -lm

ifeq ($(OS_NAME),darwin)
# 10.4 Tiger
  FAT_FLAGS = -arch ppc -arch ppc64 -arch i386
# 10.5 Leopard
#  FAT_FLAGS = -arch ppc -arch ppc7400 -arch ppc64 -arch i386 -arch x86_64
  CFLAGS += -I/sw/include -I$(externals_src)/pdp/include -DMACOSX -DUNIX -Dunix -DDL_OPEN
56
  LDFLAGS += -bundle -bundle_loader $(pd_src)/bin/pd-l2ork -undefined dynamic_lookup \
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
		-L/sw/lib -weak_framework Carbon
  LIBS += -lc 
  DYLIB_LDFLAGS = -dynamiclib -undefined dynamic_lookup -read_only_relocs warning -L/sw/lib
  STRIP = strip -x
endif
ifeq ($(OS_NAME),linux)
  CFLAGS += -I$(externals_src)/pdp/include -DUNIX -Dunix -DDL_OPEN -fPIC -O2
  LDFLAGS += -Wl,--export-dynamic  -shared -fPIC
  LIBS += -lc
  DYLIB_LDFLAGS = $(LDFLAGS)
  STRIP = strip --strip-unneeded -R .note -R .comment
endif
ifeq ($(OS_NAME),windows)
  BUILDSRC_OS_NAME = win
  WINDOWS_HACKS = -D'O_NONBLOCK=1' -D'srand48(n)=srand((n))' \
    -D'drand48()=((double)rand()/RAND_MAX)' -D'bzero(p,n)=memset(p,0,n)'
# These don't seem to be needed:
#	-D'PROT_READ=1' \
#	-D'MAP_PRIVATE=2' \
#	-D'O_NDELAY=O_NONBLOCK'
  CFLAGS += -mms-bitfields -DMSW -DNT $(WINDOWS_HACKS)
  LDFLAGS += -s -shared
# all of these included libs are part of libc in UNIX platforms.  All except
# libregex are in DLLs, so they get stripped from the external's .dll binary
  LIBS += -L$(pd_src)/src -L$(pd_src)/bin -L$(pd_src)/obj -lpd \
82
    -lwsock32 -liphlpapi -lpthread -lkernel32 -luser32 -lgdi32 -lregex
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
  DYLIB_LDFLAGS = -shared
  STRIP = strip --strip-unneeded -R .note -R .comment
endif

CXXFLAGS = $(CFLAGS)

### C++ files
%.$(EXTENSION): %.cpp
%.$(EXTENSION): %.cc
	$(CXX) $(OPT_CFLAGS) $(CXXFLAGS) -o "$*.o" -c "$<"
	$(CXX) $(LDFLAGS) -o "$*.$(EXTENSION)" "$*.o" $(LIBS)
	chmod a-x "$*.$(EXTENSION)"
#	$(STRIP) $*.$(EXTENSION)
#	rm -f -- $*.o

%.o: %.cpp
%.o: %.cc
	$(CXX) $(OPT_CFLAGS) $(CXXFLAGS) -o "$*.o" -c "$<"


### C files
%.o: %.c
	$(CC) $(OPT_CFLAGS) $(CFLAGS) -o "$*.o" -c "$*.c"

%.$(EXTENSION): %.o
	$(CC) $(LDFLAGS) -o "$*.$(EXTENSION)" "$*.o"  $(LIBS) \
		`test -f $*.libs && cat $*.libs`	\
		`my_dylib=$(patsubst $(externals_src)/%,%,$(@D)); test -f $(@D)/lib$${my_dylib}.$(DYLIB_EXTENSION) && echo -L$(@D) -l$$my_dylib` \
		`my_obj=$(patsubst $(externals_src)/%,%,$(@D)); test -f $(@D)/shared/$${my_obj}.o && echo $(@D)/shared/$${my_obj}.o` \
		`test -f $(dir $*)../$(BUILDSRC_OS_NAME)/$(notdir $*).libs && \
			cat $(dir $*)../$(BUILDSRC_OS_NAME)/$(notdir $*).libs`
	chmod a-x "$*.$(EXTENSION)"
	$(STRIP) $*.$(EXTENSION)
	rm -f -- $*.o




#------------------------------------------------------------------------------#
# ALL

# if your library isn't included in LIB_TARGETS, it won't be built with
# Pd-extended.  For libraries that build on all platforms, add them directly
# below, otherwise add to the correct platforms below.

#
# WARNING!  this MUST be all on one line because the automatic package
# building scripts rely on it being that way.
131
LIB_TARGETS = adaptive arraysize autotune bassemu boids bsaylor comport creb cxc cyclone disis earplug ekext ext13 fftease fluid freeverb ggee hcs iem_ambi iem_bin_ambi iemlib iemgui iemguts iem_adaptfilt iemmatrix iemxmlrpc iem_delay iem_roomsim iem_spec2 iem_tab jasch_lib loaders-hexloader loaders-libdir lyonpotpourri mapping markex maxlib mjlib moocow moonlib motex mrpeach oscx pan pdcontainer pddp pdogg plugin pmpd rjlib sigpack smlib tof unauthorized vbap windowing zexy
132
133

# DISABLED: flatgui
134

135
136
# NEW (IN-PROGRESS): flext

137
138
# this is for libraries that don't compile (yet) on all platforms
ifeq ($(OS_NAME),windows)
Jonathan Wilkes's avatar
Jonathan Wilkes committed
139
  LIB_TARGETS += gem
140
141
142
else
  ifeq ($(OS_NAME),darwin)
# on Mac OS X 10.6/Snow Leopard don't build hid since it needs Carbon
143
    LIB_TARGETS += pdp iem16 apple
144
    ifneq ($(shell uname -r | sed 's|10\.[0-9][0-9]*\.[0-9][0-9]*|10|'),10)
145
      LIB_TARGETS +=
146
147
    endif
  else
148
149
    # GNU/Linux, BSD, IRIX, etc. (we use exported variable INCREMENTAL to avoid rebuilding entire Gem lib that takes a long time to compile)
    ifeq ($(INCREMENTAL),yes)
150
	LIB_TARGETS += hid pdp iem16
151
    else
152
	LIB_TARGETS += gem pdp hid iem16
153
    endif
154
155
156
157
158
159
160
161
162
163
  endif
endif

#------------------------------------------------------------------------------#

all: $(LIB_TARGETS)
	@echo " "
	@echo "Compiled externals for $(OS_NAME) aka $(UNAME)"


164
install: $(examplesdir) $(manualsdir) $(objectsdir) \
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
all $(patsubst %, %_install,$(LIB_TARGETS))
	@echo " "
	@echo "externals install succeeded!"


#==============================================================================#
#
# OLD EXTERNALS BUILD SYSTEM TARGETS
#
# This is all stuff related to the externals/build/src/*.c links.  The idea is
# that they make for a flat namespace, here they are included as a libdir
#
#==============================================================================#

FLATSPACE_NAME=flatspace
FLATSPACE_OBJECTS := $(wildcard $(externals_src)/build/src/*.c)

flatspace: $(FLATSPACE_OBJECTS:.c=.$(EXTENSION))

flatspace_install: flatspace $(objectsdir)
	install -d $(DESTDIR)$(objectsdir)/$(FLATSPACE_NAME)
	$(scripts_src)/generate-libdir-metafile.sh $(DESTDIR)$(objectsdir) $(FLATSPACE_NAME) \
		--author "Numerous" \
		--description "This is a collection of externals in a flat namespace" \
		--license "GNU GPL"
	install -p $(FLATSPACE_OBJECTS:.c=.$(EXTENSION)) $(DESTDIR)$(objectsdir)/$(FLATSPACE_NAME)
# all standard objs' help files, it had to be broken up because the list is
# soo long.  They are installed only inside of the libdir since this is so
# messy.  We don't these help patches to come up for other objects
	install -p \
			$(externals_src)/arraysize/*.pd \
			$(externals_src)/beatpipe/*.pd \
			$(externals_src)/bsaylor/help/*.pd \
			$(externals_src)/control/*/*.pd \
			$(externals_src)/bbogart/chaos/tools/*.pd \
			$(externals_src)/bbogart/*/*.pd \
				$(DESTDIR)$(objectsdir)/$(FLATSPACE_NAME)
	install -p \
			$(externals_src)/ff/*.pd \
			$(externals_src)/hcs/folder_list-help.pd \
			$(externals_src)/hcs/split_path-help.pd \
				$(DESTDIR)$(objectsdir)/$(FLATSPACE_NAME)
	install -p \
			$(externals_src)/iem/comport/*/*-help.pd \
			$(externals_src)/plugin~/*.pd \
			$(externals_src)/rhythm_estimator/*.p? \
				$(DESTDIR)$(objectsdir)/$(FLATSPACE_NAME)


flatspace_clean:
	-rm -f -- $(FLATSPACE_OBJECTS:.c=.o) 
	-rm -f -- $(FLATSPACE_OBJECTS:.c=.$(EXTENSION))
	-rm -f -- $(externals_src)/build/src/*.*~
	-rm -f -- $(externals_src)/build/src/*.c.bak



#==============================================================================#
#
# PROJECT TARGETS
#
#==============================================================================#

# this is the template for creating new entries:

#------------------------------------------------------------------------------#
# TEMPLATE
TEMPLATE_NAME=template
TEMPLATE_OBJECTS := $(wildcard $(externals_src)/template/*.c)
template: $(TEMPLATE_OBJECTS:.c=.$(EXTENSION))

template_install: template
	install -d $(DESTDIR)$(objectsdir)/$(TEMPLATE_NAME)
	$(scripts_src)/generate-libdir-metafile.sh $(DESTDIR)$(objectsdir) $(TEMPLATE_NAME) \
		--author "" \
		--description "" \
		--license "" \
		--version ""
	install -p $(TEMPLATE_OBJECTS:.c=.$(EXTENSION)) $(DESTDIR)$(objectsdir)/$(TEMPLATE_NAME)
#	install -d $(manualsdir)/$(TEMPLATE_NAME)
#	install -p $(externals_src)/template/manual.txt \
#		$(manualsdir)/$(TEMPLATE_NAME)
	install -d $(DESTDIR)$(examplesdir)/$(TEMPLATE_NAME)
	install -p $(externals_src)/template/examples/*.pd \
		$(DESTDIR)$(examplesdir)/$(TEMPLATE_NAME)

template_clean:
	-rm -f -- $(TEMPLATE_OBJECTS:.c=.$(EXTENSION))
	-rm -f -- $(TEMPLATE_OBJECTS:.c=.o)
	-rm -f -- $(externals_src)/template/*.bak
	-rm -f -- $(externals_src)/template/*.*~




#------------------------------------------------------------------------------#
# AKA.WIIREMOTE
# this is installed into the "io" library
AKA.WIIREMOTE_NAME=io
AKA.WIIREMOTE_SRC := $(wildcard $(externals_src)/io/aka.wiiremote/*.c)

AKA.WIIREMOTE_OBJECTS := $(AKA.WIIREMOTE_SRC:.c=.o)
$(AKA.WIIREMOTE_OBJECTS) : %.o : %.c
	$(CC) $(OPT_CFLAGS) $(CFLAGS) -o "$*.o" -c "$*.c"

$(externals_src)/io/aka.wiiremote/akawiiremote.$(EXTENSION): $(AKA.WIIREMOTE_OBJECTS) 
	$(CC) $(LDFLAGS) -o $(externals_src)/io/aka.wiiremote/akawiiremote.$(EXTENSION) \
		$(AKA.WIIREMOTE_OBJECTS) -weak_framework IOBluetooth \
		-weak_framework CoreFoundation
#	$(STRIP) $(externals_src)/io/aka.wiiremote/aka.wiiremote.$(EXTENSION)

aka.wiiremote: $(externals_src)/io/aka.wiiremote/akawiiremote.$(EXTENSION)

aka.wiiremote_install: aka.wiiremote
	install -d $(DESTDIR)$(objectsdir)/$(AKA.WIIREMOTE_NAME)
	install -p $(externals_src)/io/aka.wiiremote/aka.wiiremote.$(EXTENSION) \
		$(DESTDIR)$(objectsdir)/$(AKA.WIIREMOTE_NAME)
	install -d $(DESTDIR)$(manualsdir)/$(AKA.WIIREMOTE_NAME)
	install -p $(externals_src)/io/aka.wiiremote/*.txt \
		$(DESTDIR)$(manualsdir)/$(AKA.WIIREMOTE_NAME)

aka.wiiremote_clean:
	-rm -f -- $(externals_src)/io/aka.wiiremote/aka.wiiremote.$(EXTENSION)
	-rm -f -- $(AKA.WIIREMOTE_OBJECTS:.c=.o)
	-rm -f -- $(externals_src)/io/aka.wiiremote/*.bak
	-rm -f -- $(externals_src)/io/aka.wiiremote/*.*~



#------------------------------------------------------------------------------#
# APPLE
apple:
	make -C $(externals_src)/apple PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)"

apple_install:
	make -C $(externals_src)/apple DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" install

apple_clean:
	make -C $(externals_src)/apple clean

305
306
307
308
309
310
311
312
313
314
315
316
317
#------------------------------------------------------------------------------#
# AUTOTUNE
autotune:
	make -C $(externals_src)/autotune PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)"

autotune_install:
	make -C $(externals_src)/autotune DESTDIR="$(DESTDIR)" \
		objectsdir="$(objectsdir)" install
	install -p $(externals_src)/autotune/autotune_scale_warp.png \
		$(DESTDIR)/$(objectsdir)/images

autotune_clean:
	make -C $(externals_src)/autotune clean
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398

#------------------------------------------------------------------------------#
# ARRAYSIZE
arraysize:
	make -C $(externals_src)/arraysize PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)"

arraysize_install:
	make -C $(externals_src)/arraysize DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" install

arraysize_clean:
	make -C $(externals_src)/arraysize clean


#------------------------------------------------------------------------------#
# BASSEMU
bassemu:
	make -C $(externals_src)/bassemu~ PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)"

bassemu_install:
	make -C $(externals_src)/bassemu~ DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" install

bassemu_clean:
	make -C $(externals_src)/bassemu~ clean


#------------------------------------------------------------------------------#
# BOIDS
boids:
	make -C $(externals_src)/boids PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)"

boids_install:
	make -C $(externals_src)/boids \
		DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" install

boids_clean:
	make -C $(externals_src)/boids clean


#------------------------------------------------------------------------------#
# BSAYLOR
bsaylor:
	make -C $(externals_src)/bsaylor PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)"

bsaylor_install:
	make -C $(externals_src)/bsaylor \
		DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" install

bsaylor_clean:
	make -C $(externals_src)/bsaylor clean


#------------------------------------------------------------------------------#
# COMPORT
comport:
	make -C $(externals_src)/iem/comport/comport PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)"

comport_install:
	make -C $(externals_src)/iem/comport/comport \
		DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" install

comport_clean:
	make -C $(externals_src)/iem/comport/comport clean


#------------------------------------------------------------------------------#
# CREB
CREB_NAME=creb
CREB_OBJECTS := $(wildcard $(externals_src)/creb/modules/*.c)
CREB_CXXOBJECTS := $(wildcard $(externals_src)/creb/modules++/*.cc)

creb: $(CREB_OBJECTS:.c=.$(EXTENSION)) $(CREB_CXXOBJECTS:.cc=.$(EXTENSION))

creb_install: creb
	install -d $(DESTDIR)$(objectsdir)/$(CREB_NAME)
	$(scripts_src)/generate-libdir-metafile.sh $(DESTDIR)$(objectsdir) $(CREB_NAME) \
		--author "Tom Schouten <tom@zwizwa.be>" \
		--description "This is a collection of pd externals. My bag of tricks." \
		--license "GNU GPL 2" \
		--version "0.9.2"
	install -p $(externals_src)/creb/abs/*.pd $(DESTDIR)$(objectsdir)/$(CREB_NAME)
	install -p $(CREB_OBJECTS:.c=.$(EXTENSION)) \
399
400
		$(CREB_CXXOBJECTS:.cc=.$(EXTENSION)) \
		$(DESTDIR)$(objectsdir)/$(CREB_NAME)
401
	install -p $(externals_src)/creb/doc/*.* $(DESTDIR)$(objectsdir)/$(CREB_NAME)
402
	install -d $(DESTDIR)$(objectsdir)/$(CREB_NAME)/manual
403
	install -p $(externals_src)/creb/doc/reference.txt \
404
405
406
407
		$(DESTDIR)$(objectsdir)/$(CREB_NAME)/manual
	install -d $(DESTDIR)$(objectsdir)/$(CREB_NAME)/examples
	install -p $(externals_src)/creb/doc/examples/*.* \
		$(DESTDIR)$(objectsdir)/$(CREB_NAME)/examples
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432

creb_clean:
	-rm -f -- $(CREB_OBJECTS:.c=.$(EXTENSION))
	-rm -f -- $(CREB_OBJECTS:.c=.o)
	-rm -f -- $(CREB_CXXOBJECTS:.cc=.$(EXTENSION))
	-rm -f -- $(CREB_CXXOBJECTS:.cc=.o)
	-rm -f -- $(externals_src)/creb/*/*.bak
	-rm -f -- $(externals_src)/creb/*/*.*~


#------------------------------------------------------------------------------#
# CXC
cxc:
	make -C $(externals_src)/cxc PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)"

cxc_install:
	make -C $(externals_src)/cxc DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" install

cxc_clean:
	make -C $(externals_src)/cxc clean


#------------------------------------------------------------------------------#
# CYCLONE
cyclone:
433
434
435
436
437
438
439
ifeq ($(OS_NAME),windows)
	make -C $(externals_src)/cyclone \
		pdbinpath=$(pd_src)/src PDINCLUDEDIR=$(DESTDIR)$(includedir)
else
	make -C $(externals_src)/cyclone \
		PDDIR=$(pd_src)
endif
440
441

cyclone_install:
442
	make -C $(externals_src)/cyclone \
443
444
445
446
		DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" \
		install

cyclone_clean:
447
	make -C $(externals_src)/cyclone \
448
449
		clean

450
451
452
#------------------------------------------------------------------------------#
# DISIS
disis:
453
ifneq ($(OS_NAME),windows)
454
ifneq ($(OS_NAME),darwin)
455
456
	cd $(externals_src)/disis/cwiid && aclocal && autoconf && \
		./configure --with-python=python2 && make
457
endif
458
459
endif
	make -C $(externals_src)/disis PD_PATH=$(pd_src) pdbinpath=$(pd_src)/src
460
461
462
463
464
465
466

disis_install:
	make -C $(externals_src)/disis \
		DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" \
		install

disis_clean:
467
468
ifneq ($(OS_NAME),windows)
ifneq ($(OS_NAME),darwin)
469
	make -C $(externals_src)/disis/cwiid clean
470
471
endif
endif
472
	make -C $(externals_src)/disis clean
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496

#------------------------------------------------------------------------------#
# EKEXT
ekext:
	make -C $(externals_src)/ekext PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)"

ekext_install:
	make -C $(externals_src)/ekext DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" install

ekext_clean:
	make -C $(externals_src)/ekext clean


#------------------------------------------------------------------------------#
# EXT13
ext13:
	make -C $(externals_src)/ext13 PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)"

ext13_install:
	make -C $(externals_src)/ext13 DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" install

ext13_clean:
	make -C $(externals_src)/ext13 clean

497
498
499
500
501
#------------------------------------------------------------------------------#
# FFTEASE
FFTEASE_NAME=fftease

fftease:
502
	make -C $(externals_src)/$(FFTEASE_NAME) PD_PATH=$(pd_src)
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524

fftease_install:
	#make -C $(externals_src)/$(FFTEASE_NAME) DESTDIR="$(DESTDIR)" \
	#	objectsdir="$(objectsdir)" install
	install -d $(DESTDIR)$(objectsdir)/$(FFTEASE_NAME)
	install -d $(DESTDIR)$(objectsdir)/$(FFTEASE_NAME)/sound
	install -p $(externals_src)/$(FFTEASE_NAME)/*.$(EXTENSION) \
		$(DESTDIR)$(objectsdir)/$(FFTEASE_NAME)
	install -p $(externals_src)/$(FFTEASE_NAME)/fftease32-helpfiles/sound/*.* \
		$(DESTDIR)$(objectsdir)/$(FFTEASE_NAME)/sound
	# copy the meta file and the shared lib
	install -p $(externals_src)/$(FFTEASE_NAME)/libfftease* \
		$(DESTDIR)$(objectsdir)/$(FFTEASE_NAME)
	# license and readme
	install -p $(externals_src)/$(FFTEASE_NAME)/*.txt \
		$(DESTDIR)$(objectsdir)/$(FFTEASE_NAME)
	# install help files
	install -p $(externals_src)/$(FFTEASE_NAME)/fftease32-helpfiles/*.pd \
		$(DESTDIR)$(objectsdir)/$(FFTEASE_NAME)

fftease_clean:
	make -C $(externals_src)/$(FFTEASE_NAME) clean
525

526
527
528
529
530
531
532
533
534
#------------------------------------------------------------------------------#
# FLATGUI
flatgui:
	make -C $(externals_src)/flatgui CFLAGS="$(CFLAGS)" \
		PD_PATH=$(pd_src) PD_INCLUDE=$(pd_src)/src

flatgui_install:
	make -C $(externals_src)/flatgui STRIP="$(STRIP)" \
		DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" install
535

536
537
flatgui_clean:
	make -C $(externals_src)/flatgui clean
538

539
540
541
542
#------------------------------------------------------------------------------#
# FLEXT and FLEXT externals
flext:
	cd $(externals_src)/grill/trunk/flext && \
543
	./bootstrap.sh || ./bootstrap.sh && \
544
545
546
547
548
549
	./build.sh pd gcc build && \
	./build.sh pd gcc build && \
	./build.sh pd gcc build && \
	./build.sh pd gcc install

	#fluid~
550
551
552
#	cd footils/fluid && \
#	../../grill/trunk/flext/build.sh pd gcc build && \
#	../../grill/trunk/flext/build.sh pd gcc build
553
554
555
556
557
558
559
560
561
562
563

	#disis_munger~
	cd ../l2ork_addons/disis_munger && \
	../../externals/grill/trunk/flext/build.sh pd gcc build && \
	../../externals/grill/trunk/flext/build.sh pd gcc build

flext_install:
	# we don't install flext but rather link it statically,
	# so we only install statically linked externals

	#fluid~
564
565
566
#	cd footils/fluid && \
#	install -D pd-linux/release-multi/fluid~.pd_linux $(DESTDIR)$(objectsdir)/flext/fluid~.pd_linux && \
#	install -D pd/* $(DESTDIR)$(objectsdir)/flext/
567
568
569
570
571
572
573
574
575
576
577
578

	#disis_munger~
	cd ../l2ork_addons/disis_munger && \
	install -D pd-linux/release-multi/disis_munger~.pd_linux $(DESTDIR)$(objectsdir)/flext/disis_munger~.pd_linux && \
	install -D *help.pd $(DESTDIR)$(objectsdir)/flext/

flext_clean:
	#flext
	cd grill/trunk/flext/ && \
	./build.sh pd gcc clean

	#fluid~
579
580
#	cd footils/fluid && \
#	../../grill/trunk/flext/build.sh pd gcc clean
581
582
583
584

	#fluid~
	cd ../l2ork_addons/disis_munger && \
	../../externals/grill/trunk/flext/build.sh pd gcc clean
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603

#------------------------------------------------------------------------------#
# FLIB
FLIB_NAME=flib
# exclude the flib.c file for the single-file library
# plus ha~.c doesn't compile at the moment.
FLIB_OBJECTS := $(wildcard $(externals_src)/postlude/flib/src/[a-ei-z]*.c)
flib: $(FLIB_OBJECTS:.c=.$(EXTENSION))

flib_install: flib
	install -d $(DESTDIR)$(objectsdir)/$(FLIB_NAME)
	$(scripts_src)/generate-libdir-metafile.sh $(DESTDIR)$(objectsdir) $(FLIB_NAME) \
		--author "Jamie Bullock" \
		--description "library for feature extraction" \
		--license "GNU GPL"
	install -p $(FLIB_OBJECTS:.c=.$(EXTENSION)) $(DESTDIR)$(objectsdir)/$(FLIB_NAME)
	install -p $(externals_src)/postlude/flib/doc/*.pd \
		$(DESTDIR)$(objectsdir)/$(FLIB_NAME)
	install -p $(externals_src)/postlude/flib/README \
604
		$(DESTDIR)$(objectsdir)/$(FLIB_NAME)/README.txt
605
606
607
608
609
610
611

flib_clean:
	-rm -f -- $(FLIB_OBJECTS:.c=.$(EXTENSION))
	-rm -f -- $(FLIB_OBJECTS:.c=.o)
	-rm -f -- $(externals_src)/postlude/flib/*/*.bak
	-rm -f -- $(externals_src)/postlude/flib/*/*.*~

612
613
614
615
#------------------------------------------------------------------------------#
# FLUID~

fluid:
616
617
	make -C $(externals_src)/fluid~ PD_PATH=$(pd_src) \
		pdbinpath=$(pd_src)/src
618
619
620
621

fluid_install:
	make -C $(externals_src)/fluid~ DESTDIR="$(DESTDIR)" \
		objectsdir="$(objectsdir)" install
622

623
624
fluid_clean:
	make -C $(externals_src)/fluid~ clean
625
626
627
628
629
630
631
632
633
634
635
636
637

#------------------------------------------------------------------------------#
# FREEVERB
freeverb:
	make -C $(externals_src)/freeverb~ PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)"

freeverb_install:
	make -C $(externals_src)/freeverb~ DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" install

freeverb_clean:
	make -C $(externals_src)/freeverb~ clean


638
639
640
641
642
643
644
645
646
#------------------------------------------------------------------------------
# GEM
GEM_NAME = Gem
$(gem_src)/configure:
	cd $(gem_src) && ./autogen.sh

$(gem_src)/Gem.dll: $(gem_src)/configure
	cd $(gem_src) && ./configure \
		CXXFLAGS="-DHAVE_S_STUFF_H" \
647
648
649
650
651
652
		--host=i686-w64-mingw32 \
		--without-ALL \
		--with-ftgl \
		--with-ftgl-cflags="-I/mingw32/include -I/mingw32/include/freetype2" \
		--with-ftgl-libs="-L/mingw32/lib -lftgl" \
		--with-vfw32 \
653
654
		--prefix=$(prefix) \
		--libdir=$(objectsdir) \
Jonathan Wilkes's avatar
Jonathan Wilkes committed
655
		--with-pd=$(DESTDIR)
656
657
658
	$(MAKE) -C $(gem_src)

$(gem_src)/Gem.pd_linux: $(gem_src)/configure
659
660
661
662
663
664
665
	test -s $(gem_src)/Gem.pd_linux || \
		cd $(gem_src) && ./configure \
			CXXFLAGS="-DHAVE_S_STUFF_H" \
			--prefix=$(prefix) \
			--with-video=plugins \
			--with-film=plugins \
			--with-pd=$(pd_src)
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
	$(MAKE) -C $(gem_src)

$(gem_src)/Gem.pd_darwin: $(gem_src)/configure
	cd $(gem_src) && ./configure \
		CXXFLAGS="-DHAVE_S_STUFF_H" \
		PKG_FTGL_CFLAGS="-I/sw/include -I/sw/include/freetype2 -I/sw/include/FTGL" \
		--prefix=$(prefix) \
		--libdir=$(objectsdir) \
		--without-ALL \
		--with-ftgl --with-ftgl-libs=/sw/lib \
		--with-artoolkit-includes=/sw/include --with-artoolkit-libs=/sw/lib \
		--with-video=plugins \
		--with-film=plugins \
		--with-pd=$(pd_src)
	$(MAKE) -C $(gem_src)

gem: $(gem_src)/Gem.$(EXTENSION)

gem_install: gem
	$(MAKE) -C $(gem_src) DESTDIR=$(DESTDIR) prefix=$(prefix) \
		libdir=$(objectsdir) pkglibdir=$(objectsdir)/Gem install

gem_clean:
	-$(MAKE) -C $(gem_src) clean

691
692
693
694
695
696

#------------------------------------------------------------------------------#
# GEM2PDP
GEM2PDP_NAME=gem2pdp
GEM2PDP_OBJECTS := $(wildcard $(externals_src)/gem2pdp/*.cpp)
$(externals_src)/gem2pdp/configure: $(externals_src)/gem2pdp/configure.ac
697
	cd $(externals_src)/gem2pdp && aclocal && autoconf
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715

$(externals_src)/gem2pdp/Makefile: $(externals_src)/gem2pdp/Makefile.in
	cd $(externals_src)/gem2pdp && ./configure --with-pddir=$(pd_src) \
		--with-gemdir=$(gem_src)  --with-pdpdir=$(externals_src)/pdp

gem2pdp: $(externals_src)/gem2pdp/configure $(externals_src)/gem2pdp/Makefile
	$(MAKE) -C $(externals_src)/gem2pdp

gem2pdp_install: gem2pdp
	install -d $(DESTDIR)$(objectsdir)
#	install -d $(DESTDIR)$(objectsdir)/$(GEM2PDP_NAME)
#	$(scripts_src)/generate-libdir-metafile.sh $(DESTDIR)$(objectsdir) $(GEM2PDP_NAME) \
#		--author "Yves Degoyon, Jamie Tittle, Georg Holzmann" \
#		--description "Bridges between Gem and PDP" \
#		--version "0.6"
	install -p $(GEM2PDP_OBJECTS:.cpp=.$(EXTENSION)) $(DESTDIR)$(objectsdir)
	install -p $(externals_src)/gem2pdp/*.pd  $(DESTDIR)$(objectsdir)
	install -p $(externals_src)/gem2pdp/README \
716
		$(DESTDIR)$(objectsdir)/$(GEM2PDP_NAME)-README.txt
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737

gem2pdp_clean:
	-rm -rf -- $(externals_src)/gem2pdp/autom4te.cache
	-rm -f -- $(externals_src)/gem2pdp/config.status
	-rm -f -- $(externals_src)/gem2pdp/config.log
	-rm -f -- $(externals_src)/gem2pdp/configure
	-rm -f -- $(externals_src)/gem2pdp/Makefile
	-rm -f -- $(GEM2PDP_OBJECTS:.cpp=.$(EXTENSION))
	-rm -f -- $(externals_src)/gem2pdp/*.o
	-rm -f -- $(externals_src)/gem2pdp/*.bak
	-rm -f -- $(externals_src)/gem2pdp/*.*~


#------------------------------------------------------------------------------#
# GGEE
ggee:
	make -C $(externals_src)/ggee PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)"

ggee_install:
	make -C $(externals_src)/ggee DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" install
	cp $(externals_src)/ggee/gui/logo100.gif $(DESTDIR)/$(objectsdir)/ggee
738
	cp $(externals_src)/ggee/gui/empty_image.png $(DESTDIR)/$(objectsdir)/ggee
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839

ggee_clean:
	make -C $(externals_src)/ggee clean


#------------------------------------------------------------------------------#
# HCS
hcs:
	make -C $(externals_src)/hcs PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)"

hcs_install:
	make -C $(externals_src)/hcs DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" install

hcs_clean:
	make -C $(externals_src)/hcs clean


#------------------------------------------------------------------------------#
# HID
HID_NAME = hid
ifeq ($(OS_NAME),windows)
  HID_CFLAGS = $(OPT_CFLAGS) $(CFLAGS) 
  HID_LIBS = $(LIBS) -lhid -lsetupapi
else
  ifeq ($(OS_NAME),darwin)
    FRAMEWORKS = Carbon IOKit ForceFeedback
    HID_CFLAGS = $(OPT_CFLAGS) $(CFLAGS) -I$(externals_src)/hid/HID\ Utilities\ Source
    HID_UTILITIES_SOURCE = $(externals_src)/hid/HID\ Utilities\ Source
    HID_LIBS = $(LIBS) -L$(HID_UTILITIES_SOURCE)/build \
		-L$(HID_UTILITIES_SOURCE)/build/Default \
      -lHIDUtilities $(patsubst %,-weak_framework %,$(FRAMEWORKS))
  else
    HID_CFLAGS = $(OPT_CFLAGS) $(CFLAGS) 
    HID_LIBS = $(LIBS)
  endif
endif

HID_SRC = input_arrays.c hid_$(OS_NAME).c hid.c
HID_OBJECTS := $(patsubst %.c, $(externals_src)/hid/%.o, $(HID_SRC))
$(HID_OBJECTS) : %.o : %.c
	$(CC) $(HID_CFLAGS) -o "$*.o" -c "$*.c"

$(HID_UTILITIES_SOURCE)/build/Default/libHIDUtilities.a:
# Apple changed the XCode CLI tool's name in xcode2... arg
# if on non-Mac OS X, this target just echos a message
ifeq ($(UNAME),Darwin)
	cd $(HID_UTILITIES_SOURCE) && \
		(test -x /usr/bin/xcodebuild && /usr/bin/xcodebuild) || \
			(test -x /usr/bin/pbxbuild && /usr/bin/pbxbuild) || \
				echo "Not building Apple HID Utilities"
endif

$(externals_src)/hid/hid.$(EXTENSION): $(HID_OBJECTS) \
$(HID_UTILITIES_SOURCE)/build/Default/libHIDUtilities.a
	$(CC) $(LDFLAGS) -o $(externals_src)/hid/hid.$(EXTENSION) \
		$(HID_OBJECTS) $(HID_LIBS)
#	$(STRIP) $(externals_src)/hid/hid.$(EXTENSION)

hid: $(externals_src)/hid/hid.$(EXTENSION)

hid_install: hid
	install -d $(DESTDIR)$(objectsdir)/$(HID_NAME)
	install -p $(externals_src)/hid/hid.$(EXTENSION) \
		$(DESTDIR)$(objectsdir)/$(HID_NAME)
	install -p $(externals_src)/hid/*.pd $(DESTDIR)$(objectsdir)/$(HID_NAME)
	install -d $(DESTDIR)$(objectsdir)/$(HID_NAME)/examples
	install -p $(externals_src)/hid/examples/*.pd  \
		$(DESTDIR)$(objectsdir)/$(HID_NAME)/examples

hid_clean:
	-rm -f -- $(externals_src)/hid/*.o
	-rm -f -- $(externals_src)/hid/hid.$(EXTENSION)
	-rm -f -- $(externals_src)/hid/*.bak
	-rm -f -- $(externals_src)/hid/*.*~
	-rm -f -- $(HID_UTILITIES_SOURCE)/build/libHIDUtilities.a
	-rm -f -- $(HID_UTILITIES_SOURCE)/build/Default/libHIDUtilities.a


#------------------------------------------------------------------------------#
# HIDIN
HIDIN_NAME=hidin
HIDIN_OBJECTS := $(wildcard $(externals_src)/olafmatt/hidin/*.c)
HIDIN_DLL := $(externals_src)/olafmatt/hidin/hidin.$(EXTENSION)

$(HIDIN_DLL): $(HIDIN_OBJECTS:.c=.o)
	$(CC) $(LDFLAGS) -o "$(HIDIN_DLL)" $(HIDIN_OBJECTS:.c=.o) $(LIBS) -lhid \
		-lsetupapi
	chmod a-x "$(HIDIN_DLL)"
	$(STRIP) $(HIDIN_DLL)

hidin: $(HIDIN_DLL)

hidin_install: hidin
	install -d $(DESTDIR)$(objectsdir)/$(HIDIN_NAME)
	$(scripts_src)/generate-libdir-metafile.sh $(DESTDIR)$(objectsdir) $(HIDIN_NAME) \
		--author "Olaf Matthes" \
		--description "HID input for Windows HID" \
		--license "GNU GPL"
	install -p $(HIDIN_DLL) $(DESTDIR)$(objectsdir)/$(HIDIN_NAME)
#	install -d $(DESTDIR)$(manualsdir)/$(HIDIN_NAME)
#	install -p $(externals_src)/olafmatt/hidin/README \
840
#		$(DESTDIR)$(objectsdir)/$(HIDIN_NAME)
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
#	install -d $(DESTDIR)$(examplesdir)/$(HIDIN_NAME)
#	install -p $(externals_src)/olafmatt/hidin/examples/*.pd \
#		$(DESTDIR)$(examplesdir)/$(HIDIN_NAME)

hidin_clean:
	-rm -f -- $(HIDIN_DLL)
	-rm -f -- $(HIDIN_OBJECTS:.c=.o)
	-rm -f -- $(externals_src)/olafmatt/hidin/*.bak
	-rm -f -- $(externals_src)/olafmatt/hidin/*.*~



#------------------------------------------------------------------------------#
# IEM_AMBI
IEM_AMBI_NAME=iem_ambi
# exclude the files for the single-file library format
IEM_AMBI_OBJECTS := $(wildcard $(externals_src)/iem/iem_ambi/src/[a-hj-z]*.c)
iem_ambi: $(IEM_AMBI_OBJECTS:.c=.$(EXTENSION))

iem_ambi_install: iem_ambi
	install -d $(DESTDIR)$(objectsdir)/$(IEM_AMBI_NAME)
	$(scripts_src)/generate-libdir-metafile.sh $(DESTDIR)$(objectsdir) $(IEM_AMBI_NAME) \
		--author "IEM/KUG, Graz, Austria" \
		--description "calculate ambisonic encoder matrices rotation matrices and decoder matrices from 1st to 4th order in 2D or 3D." \
		--license "GNU GPL" \
		--version ""
	install -p $(IEM_AMBI_OBJECTS:.c=.$(EXTENSION)) \
		$(DESTDIR)$(objectsdir)/$(IEM_AMBI_NAME)
	install -p $(externals_src)/iem/iem_ambi/*.pd \
		$(DESTDIR)$(objectsdir)/$(IEM_AMBI_NAME)
#	install -d $(DESTDIR)$(manualsdir)/$(IEM_AMBI_NAME)
	install -p $(externals_src)/iem/iem_ambi/READ_ME.txt \
873
		$(DESTDIR)$(objectsdir)/$(IEM_AMBI_NAME)/README.txt
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
#	install -d $(DESTDIR)$(examplesdir)/$(IEM_AMBI_NAME)
#	install -p $(externals_src)/iem/iem_ambi/examples/*.pd \
#		$(DESTDIR)$(examplesdir)/$(IEM_AMBI_NAME)

iem_ambi_clean:
	-rm -f -- $(IEM_AMBI_OBJECTS:.c=.$(EXTENSION))
	-rm -f -- $(IEM_AMBI_OBJECTS:.c=.o)
	-rm -f -- $(externals_src)/iem/iem_ambi/*/*.bak
	-rm -f -- $(externals_src)/iem/iem_ambi/*/*.*~



#------------------------------------------------------------------------------#
# IEM_BIN_AMBI
IEM_BIN_AMBI_NAME=iem_bin_ambi
# exclude the files for the single-file library format
IEM_BIN_AMBI_OBJECTS := $(wildcard $(externals_src)/iem/iem_bin_ambi/src/[a-hj-z]*.c)
iem_bin_ambi: $(IEM_BIN_AMBI_OBJECTS:.c=.$(EXTENSION))

iem_bin_ambi_install: iem_bin_ambi
	install -d $(DESTDIR)$(objectsdir)/$(IEM_BIN_AMBI_NAME)
	$(scripts_src)/generate-libdir-metafile.sh $(DESTDIR)$(objectsdir) $(IEM_BIN_AMBI_NAME) \
		--author "IEM/KUG, Graz, Austria" \
		--description "calculate the product of an ambisonic decoder-matrix and the binaural HRIR's (in frequency and in time domain)" \
		--license "GNU GPL" \
		--version ""
	install -p $(IEM_BIN_AMBI_OBJECTS:.c=.$(EXTENSION)) $(DESTDIR)$(objectsdir)/$(IEM_BIN_AMBI_NAME)
	install -p $(externals_src)/iem/iem_bin_ambi/*.pd \
		$(DESTDIR)$(objectsdir)/$(IEM_BIN_AMBI_NAME)
#	install -d $(DESTDIR)$(manualsdir)/$(IEM_BIN_AMBI_NAME)
	install -p $(externals_src)/iem/iem_bin_ambi/READ_ME.txt \
905
		$(DESTDIR)$(objectsdir)/$(IEM_BIN_AMBI_NAME)/README.txt
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
#	install -d $(DESTDIR)$(examplesdir)/$(IEM_BIN_AMBI_NAME)
#	install -p $(externals_src)/iem/iem_bin_ambi/examples/*.pd \
#		$(DESTDIR)$(examplesdir)/$(IEM_BIN_AMBI_NAME)

iem_bin_ambi_clean:
	-rm -f -- $(IEM_BIN_AMBI_OBJECTS:.c=.$(EXTENSION))
	-rm -f -- $(IEM_BIN_AMBI_OBJECTS:.c=.o)
	-rm -f -- $(externals_src)/iem/iem_bin_ambi/*/*.bak
	-rm -f -- $(externals_src)/iem/iem_bin_ambi/*/*.*~



#------------------------------------------------------------------------------#
# IEM16
# more externals in one file - so a little bit complicated ... ;)
IEM16_NAME=iem16
IEM16_DIR := $(externals_src)/iem16/src
IEM16_SRC := $(wildcard $(IEM16_DIR)/*.c)

$(IEM16_DIR)/aclocal.m4: $(IEM16_DIR)/acinclude.m4
	cd $(IEM16_DIR) && aclocal

$(IEM16_DIR)/configure: $(IEM16_DIR)/configure.ac $(IEM16_DIR)/aclocal.m4
	cd $(IEM16_DIR) && autoconf

$(IEM16_DIR)/Make.config: $(IEM16_DIR)/Make.config.in \
$(IEM16_DIR)/configure
	cd $(IEM16_DIR) && ./configure --disable-library \
		--with-pd=$(pd_src)

iem16: $(IEM16_DIR)/Make.config
	$(MAKE) -C $(IEM16_DIR)


iem16_install: iem16
	install -d $(DESTDIR)$(objectsdir)/$(IEM16_NAME)
	$(scripts_src)/generate-libdir-metafile.sh $(DESTDIR)$(objectsdir) $(IEM16_NAME) \
		--author "IOhannes m zmoelnig" \
		--description "16bit table, array objects for low memory usage" \
		--license "GNU GPL" \
		--version "0.1"
	install -p $(IEM16_DIR)/*.$(EXTENSION) $(DESTDIR)$(objectsdir)/$(IEM16_NAME)
	install -p $(externals_src)/iem16/help/*.pd \
		$(DESTDIR)$(objectsdir)/$(IEM16_NAME)

iem16_clean:
	-$(MAKE) -C $(IEM16_DIR) clean
	-rm -f -- $(IEM16_DIR)/*.$(EXTENSION)
	-rm -f -- $(IEM16_DIR)/*.d
	-rm -rf -- $(IEM16_DIR)/autom4ate
	-rm -rf -- $(IEM16_DIR)/conf[0-9][0-9][0-9]*
	-rm -f -- $(IEM16_DIR)/configure
	-rm -f -- $(IEM16_DIR)/Make.config
	-rm -f -- $(IEM16_DIR)/*.o
	-rm -f -- $(IEM16_DIR)/*.bak
	-rm -f -- $(IEM16_DIR)/*.*~

#------------------------------------------------------------------------------#
# IEMGUTS
IEMGUTS_NAME=iemguts
IEMGUTS_OBJECTS := $(wildcard $(externals_src)/iem/iemguts/src/*.c)
iemguts: $(IEMGUTS_OBJECTS:.c=.$(EXTENSION))


iemguts_install: iemguts
	install -d $(DESTDIR)$(objectsdir)/$(IEMGUTS_NAME)
	$(scripts_src)/generate-libdir-metafile.sh $(DESTDIR)$(objectsdir) $(IEMGUTS_NAME) \
		--author "IOhannes m zmoelnig" \
		--description "IEMguts is a collection of objects that deal with the infrastructure to build better abstractions" \
		--license "GNU GPL" \
		--version ""
	install -p $(IEMGUTS_OBJECTS:.c=.$(EXTENSION)) $(DESTDIR)$(objectsdir)/$(IEMGUTS_NAME)
	install -p $(externals_src)/iem/iemguts/help/*.pd \
		$(DESTDIR)$(objectsdir)/$(IEMGUTS_NAME)
	install -p $(externals_src)/iem/iemguts/README.txt \
981
		$(DESTDIR)$(objectsdir)/$(IEMGUTS_NAME)
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
	install -d $(DESTDIR)$(examplesdir)/$(IEMGUTS_NAME)
	install -p $(externals_src)/iem/iemguts/examples/*.pd \
		$(DESTDIR)$(examplesdir)/$(IEMGUTS_NAME)

iemguts_clean:
	-rm -f -- $(IEMGUTS_OBJECTS:.c=.$(EXTENSION))
	-rm -f -- $(IEMGUTS_OBJECTS:.c=.o)
	-rm -f -- $(externals_src)/iem/iemguts/*.bak
	-rm -f -- $(externals_src)/iem/iemguts/*.*~



#------------------------------------------------------------------------------#
# IEMLIB
IEMLIB_NAME=iemlib
# omit the lib files and iem_mp3 (for patent reasons :( )
IEMLIB_SRC := $(wildcard $(externals_src)/iemlib/iemlib1/src/*[^1].c) $(wildcard $(externals_src)/iemlib/iemlib2/src/*[^2].c)  $(wildcard $(externals_src)/iemlib/iem_t3_lib/src/t3_*.c)  $(wildcard $(externals_src)/iemlib/alias/*.c)

IEMLIB_OBJECTS := $(IEMLIB_SRC:.c=.o)