aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile92
1 files changed, 55 insertions, 37 deletions
diff --git a/makefile b/makefile
index 8f9c078..5b33c29 100644
--- a/makefile
+++ b/makefile
@@ -1,44 +1,62 @@
-current: linux
-
-.SUFFIXES: .pd_linux
-INSTALL_PREFIX = /usr
-PD_DIR = $(INSTALL_PREFIX)/lib/pd
+EXT = pd_linux
+DEFS = -DUNIX -DLINUX -DHAVE_LIBC=1 -DHAVE_LIBM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_UNISTD_H=1 -DHAVE_GETPAGESIZE=1 -DHAVE_MMAP=1 -DHAVE_SELECT=1 -DHAVE_SOCKET=1 -DHAVE_STRERROR=1 -DPD_VERSION_MINOR=36
+CC = gcc
+CXX = c++
+LD = ld
+AFLAGS =
+LFLAGS = -export_dynamic -shared
+WFLAGS =
+IFLAGS = -I. -I../../pd/src
+PREFIX=/usr/lib
+INSTALL_PREFIX=$(PREFIX)
VERSION = \"$(shell cat VERSION)\"
-#LIBOSC = ../OSC/perl/libOSC/libOSC.a
-LIBOSC =
-
-TARGETS = binshift ascwave ixprint bangfilt bangfilt2 \
- counter reson prepend split microtime ascseq \
- randomix ENV proc mean sigdelta cx
+TARNAME = cxc-$(shell cat VERSION).tar.gz
-# mean
-# serialize
+.SUFFIXES: .$(EXT)
-LINUXOBJECTS = $(TARGETS:%=%.o)
+PDCFLAGS = -g -O2 $(DEFS) $(IFLAGS) $(WFLAGS) $(LFLAGS) $(AFLAGS) -DVERSION=$(VERSION)
+CFLAGS = -g -O2 $(DEFS) $(IFLAGS) $(WFLAGS) -DVERSION=$(VERSION)
+CXXFLAGS = $(CFLAGS)
-LINCLUDE = -I. -I../../pd/src
-# possible defines
-# -DPRINTADDRS
-DEBUG = -DDEBUG -ggdb
-#DEBUG =
-CFLAGS = -O2 -DPD -DVERSION=$(VERSION) $(DEBUG) -fPIC $(LINCLUDE)
LIBS = -lc -lm
-linux: $(LINUXOBJECTS)
- ld -export_dynamic -shared -o cxc.pd_linux *.o $(LIBS) ${LIBOSC}
- strip --strip-unneeded cxc.pd_linux
-
-.c.pd_linux:
- cc $(CFLAGS) -c $*.c ${LIBOSC}
-
-clean:
- rm *.pd_linux *.o *~
-
-install:
- install -d $(PD_DIR)/doc/5.reference/cxc
- install -m664 reference/*.pd $(PD_DIR)/doc/5.reference/cxc
- install -m664 cxc.pd_linux $(PD_DIR)/externs
-uninstall:
- rm -rf $(PD_DIR)/doc/5.reference/cxc
- rm -rf $(PD_DIR)/externs/cxc.pd_linux
+#LIBS = -lpthread -lm -lc
+SOURCES = ENV.c ascseq.c ascwave.c bangfilt.c bangfilt2.c binshift.c counter.c cx.c ixprint.c mean.c microtime.c prepend.c proc.c randomix.c reson.c sigdelta.c split.c
+TARGETS = $(SOURCES:.c=.$(EXT))
+
+# all: $(TARGETS)
+all: cxc
+
+cxc: $(TARGETS)
+# cc -c $(CFLAGS) -o cxc.o -DPD cx.c
+ $(LD) $(LFLAGS) -o cxc.$(EXT) *.o $(LIBS)
+ strip --strip-unneeded cxc.$(EXT)
+
+clean::
+ -rm *.$(EXT) *.o
+
+distclean: clean
+ -rm config.cache config.log config.status makefile
+
+
+
+.c.o:
+ $(CC) -c -o $@ $(CFLAGS) -DPD $*.c
+
+# cp $@ $*_stat.o
+
+.o.$(EXT):
+ $(CC) -o $@ $(PDCFLAGS) -DPD $*.o
+
+
+
+install::
+ install -d $(INSTALL_PREFIX)/pd/externs
+# install -m 644 *.$(EXT) $(INSTALL_PREFIX)/pd/externs
+ -install -m 644 cxc.$(EXT) $(INSTALL_PREFIX)/pd/externs
+ install -m 644 reference/*.pd $(INSTALL_PREFIX)/pd/doc/5.reference
+
+
+dist: distclean
+ (cd ..;tar czvf $(TARNAME) cxc)