blob: 5825813d6da0f8991dc0c39531d9ae3e64d38b81 (
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
|
#!/usr/bin/make
DEBUG?=0
OS := $(shell uname -s)
TCL_VERSION := $(shell echo 'puts $$tcl_version' | tclsh)
ifeq ($(DEBUG),0)
CFLAGS += -O2
else
CFLAGS += -O0 -g -ggdb -DDEBUG
endif
ifeq ($(OS),Linux)
PDSUF = .pd_linux
PDBUNDLEFLAGS = -shared -rdynamic
LDSOFLAGS = -lm
endif
ifeq ($(OS),Darwin)
PDSUF = .pd_darwin
INCLUDES = -I/Library/Frameworks/Tcl.framework/Headers
PDBUNDLEFLAGS = -bundle -flat_namespace -undefined dynamic_lookup
LDSOFLAGS = -lm
endif
ifeq (MINGW,$(findstring MINGW,$(UNAME)))
PDSUF = .dll
PDBUNDLEFLAGS = -shared
LDSOFLAGS = -lm
endif
LIBNAME = composer
INCLUDES = -I../../pd/src -I/usr/include #-I/usr/include/tcl$(TCL_VERSION)
CFLAGS += -funroll-loops -fno-operator-names -fno-omit-frame-pointer -falign-functions=16 -Wno-deprecated -fPIC
CFLAGS += -DPDSUF=\"$(PDSUF)\"
LDSHARED = $(CXX) $(PDBUNDLEFLAGS)
all: $(LIBNAME)$(PDSUF)
@echo '-----------------------------------------------------------------------------'
@echo ' $(LIBNAME)$(PDSUF) ('`test $(DEBUG) -eq 1 && echo debug || echo release`' build) '\
'[size: '`ls -gGh $(LIBNAME)$(PDSUF) | cut -d " " -f 3`']'
clean::
rm -f $(LIBNAME)$(PDSUF) editor_tk.cpp *.o *~
.SUFFIXES: .cpp .o
SRCS = Song.cpp Pattern.cpp Track.cpp Editor.o PdClasses.cpp
OBJS = ${SRCS:.cpp=.o}
editor_tk.cpp: editor.tk
( echo 'static const char* editor_tk[] = {'; \
sed -e 's/\(["\\]\)/\\\1/g' -e 's/^/"/' -e 's/$$/",/' \
editor.tk; echo '"" };' ) > editor_tk.cpp
Song.o: Song.cpp Song.hpp
Pattern.o: Pattern.cpp Pattern.hpp
Track.o: Track.cpp Track.hpp
Editor.o: Editor.cpp Editor.hpp editor_tk.cpp
PdClass.o: PdClasses.cpp PdClasses.hpp
.cpp.o: Makefile
$(CXX) $(CFLAGS) $(INCLUDES) -xc++ -c $<
$(LIBNAME)$(PDSUF): Makefile $(OBJS)
$(LDSHARED) $(LDSOFLAGS) $(CFLAGS) -xnone $(OBJS) -o $(LIBNAME)$(PDSUF)
|