Permalink
Browse files

updated Makefiles to use pd-lib-builder

  • Loading branch information...
umlaeute committed Feb 26, 2018
1 parent 0304079 commit 20df8ea1fcaefb922e683e13fe0c13816b04a8a3
Showing with 57 additions and 165 deletions.
  1. +12 −150 example1/Makefile
  2. +15 −5 example2/Makefile
  3. +15 −5 example3/Makefile
  4. +15 −5 example4/Makefile
@@ -1,154 +1,16 @@
# Makefile
# (c) 2006 IOhannes m zmölnig
# Makefile to build class 'helloworld' for Pure Data.
# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build
# settings and rules.
# path to pd
## change this according to your setup!
PDROOT=../../../../pd
#PDROOT=/home/zmoelnig/src/pd/
# library name
lib.name = externals.howto.example1
# here we find the sources of pd (and evtl. the pd.lib)
PDSRCDIR=$(PDROOT)/src
PDLIBDIR=$(PDROOT)/bin
# input source file (class name == source file basename)
class.sources = helloworld.c
# this is the filename-extension
# people have to specify it at the cmdline: eg "make pd_linux"
EXTENSION=$(MAKECMDGOALS)
# all extra files to be included in binary distribution of the library
datafiles =
# if no filename-extension is supplied by the user
# try to guess one, based on what "uname" tells us
UNAME := $(shell uname -s)
ifeq ($(UNAME),Linux)
DEFAULTEXTENSION= pd_linux
else
ifeq ($(UNAME),Darwin)
DEFAULTEXTENSION= pd_darwin
else
ifeq (MINGW,$(findstring MINGW,$(UNAME)))
DEFAULTEXTENSION= pd_nt
else
ifeq ($(UNAME),IRIX)
UNAMEV := $(shell uname -R)
ifeq (6.,$(findstring 6.,$(UNAMEV)))
DEFAULTEXTENSION= pd_irix6
else
DEFAULTEXTENSION= pd_irix5
endif
else
DEFAULTEXTENSION=help
endif
endif
endif
endif
# if no extension is given, call "make" again with a guessed extension
auto:
make $(DEFAULTEXTENSION)
# just a stupid fallback
help:
@echo "choose one command: make pd_linux (linux), make pd_darwin (osX), make pd_irix5 (IRIX5), make pd_irix6 (IRIX6), make dll (MSVC), make pd_nt (MinWG)"
# delete old build files
clean:
-rm -f *.dll *.pd_* *.o *.obj *~
# we want to compile all C-files we find in the current directory
SOURCES=$(sort $(filter %.c, $(wildcard *.c)))
# each C-files maps will become an external with the given filename-extension
TARGETS=$(SOURCES:.c=.$(EXTENSION))
# ----------------------- Linux -----------------------
pd_linux: $(TARGETS)
LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC \
-Wall -W -Wshadow -Wstrict-prototypes -Werror \
-Wno-unused -Wno-parentheses -Wno-switch
LINUXLDFLAGS = -shared -lc -lm
LINUXINCLUDE = -I$(PDSRCDIR)
%.pd_linux: %.c
$(CC) $(LINUXLDFLAGS) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.pd_linux $*.c
strip --strip-unneeded $*.pd_linux
# ----------------------- Mac OSX -----------------------
pd_darwin: $(TARGETS)
DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \
-Wno-unused -Wno-parentheses -Wno-switch
DARWININCLUDE = -I$(PDSRCDIR)
DARWINLDFLAGS = -bundle -undefined suppress -flat_namespace
%.pd_darwin: %.c
$(CC) $(DARWINCFLAGS) $(DARWININCLUDE) $(DARWINLDFLAGS) -o $*.pd_darwin $*.c
# ----------------------- IRIX 5.x -----------------------
pd_irix5: $(TARGETS)
SGICFLAGS5 = -o32 -DPD -DSGI -O2
SGIINCLUDE = -I$(PDSRCDIR)
SGILDFLAGS = -elf -shared -rdata_shared
%.pd_irix5: %.c
$(CC) $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c
$(LD) $(SGILDFLAGS) -o $*.pd_irix5 $*.o
rm $*.o
# ----------------------- IRIX 6.x -----------------------
pd_irix6: $(TARGETS)
SGICFLAGS6 = -DPD -DSGI -n32 \
-OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
-Ofast=ip32
%.pd_irix6: %.c
$(CC) $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c
$(LD) $(SGILDFLAGS) -o $*.pd_irix6 $*.o
rm $*.o
# ----------------------- NT -----------------------
dll: $(TARGETS)
PDNTCFLAGS = /W3 /WX /DPD /DNT /D__WIN32__ /DMSW /nologo
VC="C:\Programme\Microsoft Visual Studio\Vc98"
PDNTINCLUDE = /I. /I$(PDROOT)\tcl\include /I$(PDSRCDIR)\src /I$(VC)\include
PDNTLDIR = $(VC)\lib
PDNTLIB = $(PDNTLDIR)\libc.lib \
$(PDNTLDIR)\oldnames.lib \
$(PDNTLDIR)\kernel32.lib \
$(PDLIBDIR)\pd.lib
%.dll: %.c
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c
link /dll /export:$*_setup $*.obj $(PDNTLIB)
pd_nt: $(TARGETS)
MINGWCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer \
-Wall -W -Wshadow -Wstrict-prototypes -Werror \
-Wno-unused -Wno-parentheses -Wno-switch -mms-bitfields
MINGWLDFLAGS = -export_dynamic -shared -lm -lkernel32 -lcoldname -lcrtdll -lpd -L$(PDLIBDIR)
MINGWINCLUDE = -I$(PDSRCDIR)
%.pd_nt: %.c
$(CC) $(MINGWLDFLAGS) $(MINGWCFLAGS) $(MINGWINCLUDE) -o $*.dll $*.c
# include Makefile.pdlibbuilder from submodule directory 'pd-lib-builder'
PDLIBBUILDER_DIR=../pd-lib-builder/
include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder
@@ -1,6 +1,16 @@
# Makefile
# (c) 2006 IOhannes m zmölnig
# Makefile to build class 'counter' for Pure Data.
# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build
# settings and rules.
# just use the Makefile in ../example1/
# (so i only have to maintain one Makefile)
include ../example1/Makefile
# library name
lib.name = externals.howto.example2
# input source file (class name == source file basename)
class.sources = counter.c
# all extra files to be included in binary distribution of the library
datafiles =
# include Makefile.pdlibbuilder from submodule directory 'pd-lib-builder'
PDLIBBUILDER_DIR=../pd-lib-builder/
include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder
@@ -1,6 +1,16 @@
# Makefile
# (c) 2006 IOhannes m zmölnig
# Makefile to build class 'counter' for Pure Data.
# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build
# settings and rules.
# just use the Makefile in ../example1/
# (so i only have to maintain one Makefile)
include ../example1/Makefile
# library name
lib.name = externals.howto.example3
# input source file (class name == source file basename)
class.sources = counter.c
# all extra files to be included in binary distribution of the library
datafiles =
# include Makefile.pdlibbuilder from submodule directory 'pd-lib-builder'
PDLIBBUILDER_DIR=../pd-lib-builder/
include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder
@@ -1,6 +1,16 @@
# Makefile
# (c) 2006 IOhannes m zmölnig
# Makefile to build class 'pan~' for Pure Data.
# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build
# settings and rules.
# just use the Makefile in ../example1/
# (so i only have to maintain one Makefile)
include ../example1/Makefile
# library name
lib.name = externals.howto.example4
# input source file (class name == source file basename)
class.sources = pan~.c
# all extra files to be included in binary distribution of the library
datafiles =
# include Makefile.pdlibbuilder from submodule directory 'pd-lib-builder'
PDLIBBUILDER_DIR=../pd-lib-builder/
include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder

0 comments on commit 20df8ea

Please sign in to comment.