Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 467 lines (415 sloc) 17.337 kb
7f7dee9 @residuum Moved .c files to src subfolder.
authored
1 ## based on Pd library template version 1.0.14
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
2 # For instructions on how to use this template, see:
3 # http://puredata.info/docs/developer/MakefileTemplate
4 LIBRARY_NAME = purest_json
5
7f7dee9 @residuum Moved .c files to src subfolder.
authored
6 # objects to build from .c files in src/
7 OBJECTS = rest oauth json-decode json-encode urlparams
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
8
9 # list all pd objects (i.e. myobject.pd) files here, and their helpfiles will
10 # be included automatically
85e34f8 @residuum Updated Makefile for packaging, Version number in header file.
authored
11 PDOBJECTS =
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
12
13 # example patches and related files, in the 'examples' subfolder
85e34f8 @residuum Updated Makefile for packaging, Version number in header file.
authored
14 EXAMPLES = purest-json-test.pd the-sound-of-money.pd statistics.pd twitter-client.pd binary-test.pd
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
15
16 # manuals and related files, in the 'manual' subfolder
8eaa33b @residuum Twitter client as example for OAuth.
authored
17 MANUAL = index.html couchdb-example.png webservice-example.png twitter.html twitter-documentation.png
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
18
19 # if you want to include any other files in the source and binary tarballs,
20 # list them here. This can be anything from header files, test patches,
6acdf70 @residuum Different formats for README.md and LICENSE.txt
authored
21 # documentation, etc.
22 EXTRA_DIST = README.md LICENSE.txt Changelog.txt test.json
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
23
e445fed @eighthave update to Makefile 1.0.12
eighthave authored
24 # unit tests and related files here, in the 'unittests' subfolder
25 UNITTESTS =
26
85e34f8 @residuum Updated Makefile for packaging, Version number in header file.
authored
27 HELPPATCHES = json-help.pd urlparams-help.pd rest-help.pd
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
28
e445fed @eighthave update to Makefile 1.0.12
eighthave authored
29
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
30 #------------------------------------------------------------------------------#
31 #
32 # things you might need to edit if you are using other C libraries
33 #
34 #------------------------------------------------------------------------------#
35
36 ALL_CFLAGS = -I"$(PD_INCLUDE)" -std=c99
37 ALL_LDFLAGS =
38 SHARED_LDFLAGS =
8f42fe4 @residuum Updates for json-c > 0.11, see https://github.com/json-c/json-c/blob/mas...
authored
39 ALL_LIBS = -lcurl -ljson-c -loauth
56873d3 @residuum Correctly setting cacert for Windows.
authored
40 LIBS_windows = -lpthread -lm -lidn -lintl -lwldap32 -lgnutls -lhogweed -lgmp -lssl \
758a5f9 @residuum Revert "Makefile for MXE with Curl and Open SSL."
authored
41 -liconv -lnettle -lssh2 -lgcrypt -lgpg-error -lcrypto \
42 -lws2_32 -lgdi32 -lcrypt32 -lz
c0e2a93 @residuum Compilation with MinGW possible again.
authored
43 CFLAGS_windows = -mthreads -DCURL_STATICLIB
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
44
45
46 #------------------------------------------------------------------------------#
47 #
48 # you shouldn't need to edit anything below here, if we did it right :)
49 #
50 #------------------------------------------------------------------------------#
51
52 # these can be set from outside without (usually) breaking the build
53 CFLAGS = -Wall -W -g
54 LDFLAGS =
55 LIBS =
7a34c7f @residuum Makefile for cross compilation for Windows on Linux.
authored
56 CROSS =
57 CROSS_PATH =
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
58
59 # get library version from meta file
60 LIBRARY_VERSION = $(shell sed -n 's|^\#X text [0-9][0-9]* [0-9][0-9]* VERSION \(.*\);|\1|p' $(LIBRARY_NAME)-meta.pd)
61
7f7dee9 @residuum Moved .c files to src subfolder.
authored
62 SOURCES := $(addprefix src/,$(addsuffix .c,$(OBJECTS)))
6bd294a @residuum Debian packages: include source files by directory.
authored
63 SOURCE_FOLDERS := src src/inc src/uthash/src
64 OBJ_FILES := $(addsuffix .o,$(OBJECTS)))
7f7dee9 @residuum Moved .c files to src subfolder.
authored
65
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
66 ALL_CFLAGS += -DPD -DVERSION='"$(LIBRARY_VERSION)"'
67
68 PD_INCLUDE = $(PD_PATH)/include/pd
69 # where to install the library, overridden below depending on platform
70 prefix = /usr/local
71 libdir = $(prefix)/lib
72 pkglibdir = $(libdir)/pd-externals
73 objectsdir = $(pkglibdir)
74
75 INSTALL = install
76 INSTALL_PROGRAM = $(INSTALL) -p -m 644
77 INSTALL_DATA = $(INSTALL) -p -m 644
78 INSTALL_DIR = $(INSTALL) -p -m 755 -d
79
80 ALLSOURCES := $(SOURCES) $(SOURCES_android) $(SOURCES_cygwin) $(SOURCES_macosx) \
1c04f50 @residuum Refactoring and clean up.
authored
81 $(SOURCES_iphoneos) $(SOURCES_linux) $(SOURCES_windows) \
7f7dee9 @residuum Moved .c files to src subfolder.
authored
82 $(addprefix src/inc/,ctw.c kvp.c string.c strlist.c)
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
83
84 DISTDIR=$(LIBRARY_NAME)-$(LIBRARY_VERSION)
127013c @residuum Replace underscores by hyphens for Debian packages.
authored
85 ORIGDIR=pd-`echo $(LIBRARY_NAME:~=)|tr '_' '-'`_$(LIBRARY_VERSION)
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
86
87 UNAME := $(shell uname -s)
88 ifeq ($(UNAME),Darwin)
89 CPU := $(shell uname -p)
90 ifeq ($(CPU),arm) # iPhone/iPod Touch
91 SOURCES += $(SOURCES_iphoneos)
92 EXTENSION = pd_darwin
93 SHARED_EXTENSION = dylib
94 OS = iphoneos
95 PD_PATH = /Applications/Pd-extended.app/Contents/Resources
96 IPHONE_BASE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
97 CC=$(IPHONE_BASE)/gcc
98 CPP=$(IPHONE_BASE)/cpp
99 CXX=$(IPHONE_BASE)/g++
100 ISYSROOT = -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk
101 IPHONE_CFLAGS = -miphoneos-version-min=3.0 $(ISYSROOT) -arch armv6
102 OPT_CFLAGS = -fast -funroll-loops -fomit-frame-pointer
103 ALL_CFLAGS := $(IPHONE_CFLAGS) $(ALL_CFLAGS)
104 ALL_LDFLAGS += -arch armv6 -bundle -undefined dynamic_lookup $(ISYSROOT)
105 SHARED_LDFLAGS += -arch armv6 -dynamiclib -undefined dynamic_lookup $(ISYSROOT)
106 ALL_LIBS += -lc $(LIBS_iphoneos)
107 STRIP = strip -x
108 DISTBINDIR=$(DISTDIR)-$(OS)
109 else # Mac OS X
110 SOURCES += $(SOURCES_macosx)
111 EXTENSION = pd_darwin
112 SHARED_EXTENSION = dylib
113 OS = macosx
114 PD_PATH = /Applications/Pd-extended.app/Contents/Resources
115 OPT_CFLAGS = -ftree-vectorize -ftree-vectorizer-verbose=2 -fast
116 # build universal 32-bit on 10.4 and 32/64 on newer
117 ifeq ($(shell uname -r | sed 's|\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*|\1|'), 8)
9864535 @residuum Updates for next release:
authored
118 FAT_FLAGS = -arch ppc -arch i386 -mmacosx-version-min=10.4
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
119 else
120 SOURCES += $(SOURCES_iphoneos)
9864535 @residuum Updates for next release:
authored
121 # Starting with Xcode 4.0, the PowerPC compiler is not installed by default
122 ifeq ($(wildcard /usr/llvm-gcc-4.2/libexec/gcc/powerpc*), )
281b658 @residuum Merge pull request #29 from megrimm/osx-10.9_json-c-0.10
authored
123 FAT_FLAGS = -arch x86_64 -mmacosx-version-min=10.5
9864535 @residuum Updates for next release:
authored
124 else
125 FAT_FLAGS = -arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=10.4
126 endif
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
127 endif
128 ALL_CFLAGS += $(FAT_FLAGS) -fPIC -I/sw/include
129 # if the 'pd' binary exists, check the linking against it to aid with stripping
130 BUNDLE_LOADER = $(shell test ! -e $(PD_PATH)/bin/pd || echo -bundle_loader $(PD_PATH)/bin/pd)
9864535 @residuum Updates for next release:
authored
131 ALL_LDFLAGS += $(FAT_FLAGS) -headerpad_max_install_names -bundle $(BUNDLE_LOADER) \
132 -undefined dynamic_lookup -L/sw/lib
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
133 SHARED_LDFLAGS += $(FAT_FLAGS) -dynamiclib -undefined dynamic_lookup \
134 -install_name @loader_path/$(SHARED_LIB) -compatibility_version 1 -current_version 1.0
135 ALL_LIBS += -lc $(LIBS_macosx)
136 STRIP = strip -x
137 DISTBINDIR=$(DISTDIR)-$(OS)
138 # install into ~/Library/Pd on Mac OS X since /usr/local isn't used much
139 pkglibdir=$(HOME)/Library/Pd
140 endif
141 endif
142 # Tho Android uses Linux, we use this fake uname to provide an easy way to
143 # setup all this things needed to cross-compile for Android using the NDK
144 ifeq ($(UNAME),ANDROID)
145 CPU := arm
146 SOURCES += $(SOURCES_android)
9864535 @residuum Updates for next release:
authored
147 EXTENSION = so
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
148 SHARED_EXTENSION = so
149 OS = android
150 PD_PATH = /usr
151 NDK_BASE := /usr/local/android-ndk
9864535 @residuum Updates for next release:
authored
152 NDK_PLATFORM_LEVEL ?= 5
153 NDK_ABI=arm
154 NDK_SYSROOT=$(NDK_BASE)/platforms/android-$(NDK_PLATFORM_LEVEL)/arch-$(NDK_ABI)
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
155 NDK_UNAME := $(shell uname -s | tr '[A-Z]' '[a-z]')
9864535 @residuum Updates for next release:
authored
156 NDK_COMPILER_VERSION=4.6
157 NDK_TOOLCHAIN=$(wildcard \
158 $(NDK_BASE)/toolchains/$(NDK_ABI)*-$(NDK_COMPILER_VERSION)/prebuilt/$(NDK_UNAME)-x86)
159 CC := $(wildcard $(NDK_TOOLCHAIN)/bin/*-linux-android*-gcc) --sysroot=$(NDK_SYSROOT)
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
160 OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
161 CFLAGS +=
162 LDFLAGS += -rdynamic -shared
163 SHARED_LDFLAGS += -Wl,-soname,$(SHARED_LIB) -shared
164 LIBS += -lc $(LIBS_android)
9864535 @residuum Updates for next release:
authored
165 STRIP := $(wildcard $(NDK_TOOLCHAIN)/bin/$(NDK_ABI)-linux-android*-strip) \
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
166 --strip-unneeded -R .note -R .comment
167 DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
168 endif
169 ifeq ($(UNAME),Linux)
170 CPU := $(shell uname -m)
171 SOURCES += $(SOURCES_linux)
172 EXTENSION = pd_linux
173 SHARED_EXTENSION = so
174 OS = linux
175 PD_PATH = /usr
176 OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
177 ALL_CFLAGS += -fPIC
178 ALL_LDFLAGS += -rdynamic -shared -fPIC -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags
179 SHARED_LDFLAGS += -Wl,-soname,$(SHARED_LIB) -shared
180 ALL_LIBS += -lc $(LIBS_linux)
181 STRIP = strip --strip-unneeded -R .note -R .comment
182 DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
183 endif
184 ifeq ($(UNAME),GNU)
185 # GNU/Hurd, should work like GNU/Linux for basically all externals
186 CPU := $(shell uname -m)
187 SOURCES += $(SOURCES_linux)
188 EXTENSION = pd_linux
189 SHARED_EXTENSION = so
190 OS = linux
191 PD_PATH = /usr
192 OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
193 ALL_CFLAGS += -fPIC
194 ALL_LDFLAGS += -rdynamic -shared -fPIC -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags
195 SHARED_LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB)
196 ALL_LIBS += -lc $(LIBS_linux)
197 STRIP = strip --strip-unneeded -R .note -R .comment
198 DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
199 endif
200 ifeq ($(UNAME),GNU/kFreeBSD)
201 # Debian GNU/kFreeBSD, should work like GNU/Linux for basically all externals
202 CPU := $(shell uname -m)
203 SOURCES += $(SOURCES_linux)
204 EXTENSION = pd_linux
205 SHARED_EXTENSION = so
206 OS = linux
207 PD_PATH = /usr
208 OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
209 ALL_CFLAGS += -fPIC
210 ALL_LDFLAGS += -rdynamic -shared -fPIC -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags
211 SHARED_LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB)
212 ALL_LIBS += -lc $(LIBS_linux)
213 STRIP = strip --strip-unneeded -R .note -R .comment
214 DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
215 endif
216 ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
217 CPU := $(shell uname -m)
218 SOURCES += $(SOURCES_cygwin)
219 EXTENSION = dll
220 SHARED_EXTENSION = dll
221 OS = cygwin
222 PD_PATH = $(shell cygpath $$PROGRAMFILES)/pd
223 OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
224 ALL_CFLAGS +=
225 ALL_LDFLAGS += -rdynamic -shared -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin"
226 SHARED_LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB)
227 ALL_LIBS += -lc -lpd $(LIBS_cygwin)
228 STRIP = strip --strip-unneeded -R .note -R .comment
229 DISTBINDIR=$(DISTDIR)-$(OS)
230 endif
231 ifeq (MINGW,$(findstring MINGW,$(UNAME)))
232 CPU := $(shell uname -m)
233 SOURCES += $(SOURCES_windows)
234 EXTENSION = dll
235 SHARED_EXTENSION = dll
236 OS = windows
89c90de @residuum Squashed commit of the following:
authored
237 ifeq ($(strip $(PD_PATH)),)
238 PD_PATH = $(shell cd "$$PROGRAMFILES/pd" && pwd)
239 endif
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
240 # MinGW doesn't seem to include cc so force gcc
241 CC=gcc
7a34c7f @residuum Makefile for cross compilation for Windows on Linux.
authored
242 ifneq ($(strip $(CROSS)),)
243 CC = $(CROSS)-gcc
244 LD = $(CROSS)-ld
245 AR = $(CROSS)-ar
89c90de @residuum Squashed commit of the following:
authored
246 CFLAGS += -I$(CROSS_PATH)/$(CROSS)/include
247 LDFLAGS += -L$(CROSS_PATH)/$(CROSS)/bin -L$(CROSS_PATH)/$(CROSS)/lib
248 PATH := ${PATH}:$(CROSS_PATH)/bin
7a34c7f @residuum Makefile for cross compilation for Windows on Linux.
authored
249 endif
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
250 OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer
89c90de @residuum Squashed commit of the following:
authored
251 ALL_CFLAGS += -mms-bitfields -I"$(PD_PATH)/src" $(CFLAGS_windows)
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
252 ALL_LDFLAGS += -s -shared -Wl,--enable-auto-import -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" -L"$(PD_PATH)/obj"
5a2fbc5 @residuum Probably fixing issue #3: adding ALL_LDFLAGS to $(SHARED_LIB) target bre...
authored
253 SHARED_LDFLAGS += -shared -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" -L"$(PD_PATH)/obj"
eda299d @residuum Fix for issue #13: List all dependencies explicitely for MinGW compilati...
authored
254 ALL_LIBS += -lpd -lwsock32 -lkernel32 -luser32 $(LIBS_windows)
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
255 STRIP = strip --strip-unneeded -R .note -R .comment
256 DISTBINDIR=$(DISTDIR)-$(OS)
257 endif
258
259 # in case somebody manually set the HELPPATCHES above
260 HELPPATCHES ?= $(SOURCES:.c=-help.pd) $(PDOBJECTS:.pd=-help.pd)
261
262 ALL_CFLAGS := $(ALL_CFLAGS) $(CFLAGS) $(OPT_CFLAGS)
263 ALL_LDFLAGS := $(LDFLAGS) $(ALL_LDFLAGS)
264 ALL_LIBS := $(LIBS) $(ALL_LIBS)
265
e445fed @eighthave update to Makefile 1.0.12
eighthave authored
266 SHARED_SOURCE ?= $(wildcard lib$(LIBRARY_NAME).c)
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
267 SHARED_HEADER ?= $(shell test ! -e $(LIBRARY_NAME).h || echo $(LIBRARY_NAME).h)
9864535 @residuum Updates for next release:
authored
268 SHARED_LIB ?= $(SHARED_SOURCE:.c=.$(SHARED_EXTENSION))
e445fed @eighthave update to Makefile 1.0.12
eighthave authored
269 SHARED_TCL_LIB = $(wildcard lib$(LIBRARY_NAME).tcl)
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
270
e445fed @eighthave update to Makefile 1.0.12
eighthave authored
271 .PHONY = install libdir_install single_install install-doc install-examples install-manual install-unittests clean distclean dist etags $(LIBRARY_NAME)
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
272
7f7dee9 @residuum Moved .c files to src subfolder.
authored
273 all: $(addsuffix .$(EXTENSION),$(OBJECTS)) $(SHARED_LIB)
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
274
7f7dee9 @residuum Moved .c files to src subfolder.
authored
275 %.o: src/%.c
276 $(CC) $(ALL_CFLAGS) -o "$*.o" -c "src/$*.c"
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
277
278 %.$(EXTENSION): %.o $(SHARED_LIB)
279 $(CC) $(ALL_LDFLAGS) -o "$*.$(EXTENSION)" "$*.o" $(ALL_LIBS) $(SHARED_LIB)
280 chmod a-x "$*.$(EXTENSION)"
281
282 # this links everything into a single binary file
3fa1221 @residuum Info about library on console.
authored
283 $(LIBRARY_NAME)_vars:
284 $(eval ALL_CFLAGS += -DPUREST_JSON_LIB)
285
6bd294a @residuum Debian packages: include source files by directory.
authored
286 $(LIBRARY_NAME): $(LIBRARY_NAME)_vars $(OBJ_FILES)h $(LIBRARY_NAME).o
287 $(CC) $(ALL_LDFLAGS) -o $(LIBRARY_NAME).$(EXTENSION) $(OBJ_FILES) \
3fa1221 @residuum Info about library on console.
authored
288 $(LIBRARY_NAME).o $(ALL_LIBS)
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
289 chmod a-x $(LIBRARY_NAME).$(EXTENSION)
290
291 $(SHARED_LIB): $(SHARED_SOURCE:.c=.o)
9864535 @residuum Updates for next release:
authored
292 $(CC) $(SHARED_LDFLAGS) -o $(SHARED_LIB) $(SHARED_SOURCE:.c=.o) $(ALL_LIBS)
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
293
294 install: libdir_install
295
296 # The meta and help files are explicitly installed to make sure they are
297 # actually there. Those files are not optional, then need to be there.
52ca629 @residuum Building Debian packages.
authored
298 libdir_install: $(addsuffix .$(EXTENSION),$(OBJECTS)) $(SHARED_LIB) install-doc install-examples install-manual install-unittests
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
299 $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
300 $(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd \
301 $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
302 test -z "$(strip $(SOURCES))" || (\
52ca629 @residuum Building Debian packages.
authored
303 $(INSTALL_PROGRAM) $(addsuffix .$(EXTENSION),$(OBJECTS)) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) && \
304 $(STRIP) $(addprefix $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/,$(addsuffix .$(EXTENSION),$(OBJECTS))))
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
305 test -z "$(strip $(SHARED_LIB))" || \
306 $(INSTALL_DATA) $(SHARED_LIB) \
307 $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
308 test -z "$(strip $(wildcard $(SOURCES:.c=.tcl)))" || \
309 $(INSTALL_DATA) $(wildcard $(SOURCES:.c=.tcl)) \
310 $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
311 test -z "$(strip $(PDOBJECTS))" || \
312 $(INSTALL_DATA) $(PDOBJECTS) \
313 $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
e445fed @eighthave update to Makefile 1.0.12
eighthave authored
314 test -z "$(strip $(SHARED_TCL_LIB))" || \
315 $(INSTALL_DATA) $(SHARED_TCL_LIB) \
316 $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
317
318 # install library linked as single binary
e445fed @eighthave update to Makefile 1.0.12
eighthave authored
319 single_install: $(LIBRARY_NAME) install-doc install-examples install-manual install-unittests
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
320 $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
321 $(INSTALL_PROGRAM) $(LIBRARY_NAME).$(EXTENSION) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
322 $(STRIP) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/$(LIBRARY_NAME).$(EXTENSION)
323
324 install-doc:
325 $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
326 test -z "$(strip $(SOURCES) $(PDOBJECTS))" || \
327 $(INSTALL_DATA) $(HELPPATCHES) \
328 $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
329
330 install-examples:
331 test -z "$(strip $(EXAMPLES))" || \
332 $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/examples && \
333 for file in $(EXAMPLES); do \
334 $(INSTALL_DATA) examples/$$file $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/examples; \
335 done
336
337 install-manual:
338 test -z "$(strip $(MANUAL))" || \
339 $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/manual && \
340 for file in $(MANUAL); do \
341 $(INSTALL_DATA) manual/$$file $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/manual; \
342 done
343
e445fed @eighthave update to Makefile 1.0.12
eighthave authored
344 install-unittests:
345 test -z "$(strip $(UNITTESTS))" || \
346 $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/unittests && \
347 for file in $(UNITTESTS); do \
348 $(INSTALL_DATA) unittests/$$file $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/unittests; \
349 done
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
350
351 clean:
7f7dee9 @residuum Moved .c files to src subfolder.
authored
352 -rm -f -- $(addsuffix .o,$(OBJECTS)) $(SOURCES_LIB:.c=.o) $(SHARED_SOURCE:.c=.o)
353 -rm -f -- $(addsuffix .$(EXTENSION),$(OBJECTS))
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
354 -rm -f -- $(LIBRARY_NAME).o
355 -rm -f -- $(LIBRARY_NAME).$(EXTENSION)
356 -rm -f -- $(SHARED_LIB)
357
358 distclean: clean
359 -rm -f -- $(DISTBINDIR).tar.gz
360 -rm -rf -- $(DISTBINDIR)
361 -rm -f -- $(DISTDIR).tar.gz
362 -rm -rf -- $(DISTDIR)
363 -rm -f -- $(ORIGDIR).tar.gz
364 -rm -rf -- $(ORIGDIR)
365
366
367 $(DISTBINDIR):
368 $(INSTALL_DIR) $(DISTBINDIR)
369
370 libdir: all $(DISTBINDIR)
371 $(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd $(DISTBINDIR)
372 $(INSTALL_DATA) $(SOURCES) $(SHARED_SOURCE) $(SHARED_HEADER) $(DISTBINDIR)
373 $(INSTALL_DATA) $(HELPPATCHES) $(DISTBINDIR)
374 test -z "$(strip $(EXTRA_DIST))" || \
375 $(INSTALL_DATA) $(EXTRA_DIST) $(DISTBINDIR)
376 # tar --exclude-vcs -czpf $(DISTBINDIR).tar.gz $(DISTBINDIR)
377
378 $(DISTDIR):
379 $(INSTALL_DIR) $(DISTDIR)
6bd294a @residuum Debian packages: include source files by directory.
authored
380 for dir in $(SOURCE_FOLDERS); do \
381 $(INSTALL_DIR) $(DISTDIR)/$$dir; \
382 done
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
383
384 $(ORIGDIR):
385 $(INSTALL_DIR) $(ORIGDIR)
386
387 dist: $(DISTDIR)
388 $(INSTALL_DATA) Makefile $(DISTDIR)
389 $(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd $(DISTDIR)
6bd294a @residuum Debian packages: include source files by directory.
authored
390 for dir in $(SOURCE_FOLDERS); do \
391 for file in `ls $$dir`; do \
392 $(INSTALL_DATA) $$dir/$$file $(DISTDIR)/$$dir/; \
393 done; \
394 done
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
395 test -z "$(strip $(PDOBJECTS))" || \
396 $(INSTALL_DATA) $(PDOBJECTS) $(DISTDIR)
397 test -z "$(strip $(HELPPATCHES))" || \
398 $(INSTALL_DATA) $(HELPPATCHES) $(DISTDIR)
399 test -z "$(strip $(EXTRA_DIST))" || \
400 $(INSTALL_DATA) $(EXTRA_DIST) $(DISTDIR)
401 test -z "$(strip $(EXAMPLES))" || \
402 $(INSTALL_DIR) $(DISTDIR)/examples && \
403 for file in $(EXAMPLES); do \
404 $(INSTALL_DATA) examples/$$file $(DISTDIR)/examples; \
405 done
406 test -z "$(strip $(MANUAL))" || \
407 $(INSTALL_DIR) $(DISTDIR)/manual && \
408 for file in $(MANUAL); do \
409 $(INSTALL_DATA) manual/$$file $(DISTDIR)/manual; \
410 done
e445fed @eighthave update to Makefile 1.0.12
eighthave authored
411 test -z "$(strip $(UNITTESTS))" || \
412 $(INSTALL_DIR) $(DISTDIR)/unittests && \
413 for file in $(UNITTESTS); do \
414 $(INSTALL_DATA) unittests/$$file $(DISTDIR)/unittests; \
415 done
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
416 tar --exclude-vcs -czpf $(DISTDIR).tar.gz $(DISTDIR)
417
418 # make a Debian source package
419 dpkg-source:
420 debclean
421 make distclean dist
422 mv $(DISTDIR) $(ORIGDIR)
423 tar --exclude-vcs -czpf ../$(ORIGDIR).orig.tar.gz $(ORIGDIR)
424 rm -f -- $(DISTDIR).tar.gz
425 rm -rf -- $(DISTDIR) $(ORIGDIR)
426 cd .. && dpkg-source -b $(LIBRARY_NAME)
427
127013c @residuum Replace underscores by hyphens for Debian packages.
authored
428 dpkg-deb: dpkg-source
429 dpkg-buildpackage -b -us
430
e445fed @eighthave update to Makefile 1.0.12
eighthave authored
431 etags: TAGS
432
433 TAGS: $(wildcard $(PD_INCLUDE)/*.h) $(SOURCES) $(SHARED_SOURCE) $(SHARED_HEADER)
434 etags $(wildcard $(PD_INCLUDE)/*.h)
435 etags -a *.h $(SOURCES) $(SHARED_SOURCE) $(SHARED_HEADER)
436 etags -a --language=none --regex="/proc[ \t]+\([^ \t]+\)/\1/" *.tcl
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
437
438 showsetup:
439 @echo "CC: $(CC)"
440 @echo "CFLAGS: $(CFLAGS)"
441 @echo "LDFLAGS: $(LDFLAGS)"
442 @echo "LIBS: $(LIBS)"
443 @echo "ALL_CFLAGS: $(ALL_CFLAGS)"
444 @echo "ALL_LDFLAGS: $(ALL_LDFLAGS)"
445 @echo "ALL_LIBS: $(ALL_LIBS)"
446 @echo "PD_INCLUDE: $(PD_INCLUDE)"
447 @echo "PD_PATH: $(PD_PATH)"
448 @echo "objectsdir: $(objectsdir)"
449 @echo "LIBRARY_NAME: $(LIBRARY_NAME)"
450 @echo "LIBRARY_VERSION: $(LIBRARY_VERSION)"
451 @echo "SOURCES: $(SOURCES)"
452 @echo "SHARED_HEADER: $(SHARED_HEADER)"
453 @echo "SHARED_SOURCE: $(SHARED_SOURCE)"
454 @echo "SHARED_LIB: $(SHARED_LIB)"
e445fed @eighthave update to Makefile 1.0.12
eighthave authored
455 @echo "SHARED_TCL_LIB: $(SHARED_TCL_LIB)"
5a9caf9 @eighthave update Makefile and arrange files to match the Library Template:
eighthave authored
456 @echo "PDOBJECTS: $(PDOBJECTS)"
457 @echo "ALLSOURCES: $(ALLSOURCES)"
458 @echo "ALLSOURCES TCL: $(wildcard $(ALLSOURCES:.c=.tcl))"
459 @echo "UNAME: $(UNAME)"
460 @echo "CPU: $(CPU)"
461 @echo "pkglibdir: $(pkglibdir)"
462 @echo "DISTDIR: $(DISTDIR)"
463 @echo "ORIGDIR: $(ORIGDIR)"
9864535 @residuum Updates for next release:
authored
464 @echo "NDK_TOOLCHAIN: $(NDK_TOOLCHAIN)"
465 @echo "NDK_BASE: $(NDK_BASE)"
466 @echo "NDK_SYSROOT: $(NDK_SYSROOT)"
Something went wrong with that request. Please try again.