aboutsummaryrefslogtreecommitdiff
path: root/extended/Makefile
blob: 7c53b3bbeab6660d1aa1e8360716aa4d4905f35e (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
## -*- Mode: Makefile -*-
##
## File: externals/moocow/extended/Makefile
## Author: Bryan Jurish <moocow@bbaw.de>
## Description: pd-extended makefile for moocow's externals
##

##======================================================================
## Variables

SUBDIRS = \
	../deque \
	../pdstring \
	../readdir \
	../weightmap \
	../../sprinkler

# ../flite ../gfsm

#CFLAGS ?= -march=k8

MOOCOW_DIR   ?=$(shell pwd)
MOOCOW_BUILD ?=$(MOOCOW_DIR)/build

CONFIGURE_ARGS=\
	CFLAGS="$(CFLAGS)" \
	--with-pd-include="$(pd_src)" \
	--with-pd-dir="$(MOOCOW_BUILD)" \
	--with-pd-extdir="$(MOOCOW_BUILD)/externs"

##======================================================================
## Rules: default
all: build.stamp

autogen: $(SUBDIRS:=-autogen)
configure: $(SUBDIRS:=-configure)

build.stamp: $(SUBDIRS:=/build.stamp)
	touch $@

reamde: README.txt
README.txt: README.pod
	pod2text README.pod $@

clean:
	for d in $(SUBDIRS); do $(MAKE) -C $$d clean || true; rm -f $$d/build.stamp; done;
	rm  -f build.stamp config.log
	rm -rf $(MOOCOW_BUILD)

realclean: clean
	for d in $(SUBDIRS); do $(MAKE) -C $$d realclean || true; done;

cvsclean: clean
	for d in $(SUBDIRS); do $(MAKE) -C $$d cvsclean || true; done;


##======================================================================
## Templates: subdir

## RULES = $(call subdir_template,$(dir_path),$(configure_args))
define subdir_template
 $(1)-autogen:
	(cd $(1); ./autogen.sh) || true

 $(1)-configure: $(1)-autogen
	(cd $(1); ./configure $(CONFIGURE_ARGS) $(2)) || true

 $(1)/build.stamp: $(1)-configure
	$(MAKE) -C $(1) all install || true
	touch $$@

 $(1)-clean:
	$(MAKE) -C $(1) clean || true
endef


##======================================================================
## Rules: subdirectories

$(eval $(call subdir_template,../deque))
#$(eval $(call subdir_template,../flite))
#$(eval $(call subdir_template,../gfsm))
$(eval $(call subdir_template,../pdstring,--enable-object-externals))
$(eval $(call subdir_template,../readdir))
$(eval $(call subdir_template,../../sprinkler))
$(eval $(call subdir_template,../weightmap))