[ed] actually not sure if this is what you want, but for a PD audio external (not “standalone”?),
simple template for linux:
let’s see, for mac/win need some different link flags, here’s something i used once, ymmv
#--- linux
LINUXCFLAGS = -g -msse -DPD -O3 -funroll-loops -fomit-frame-pointer -fcheck-new \
-Wall -W -Wshadow \
-Wno-unused -Wno-parentheses -Wno-switch \
-fvisibility=hidden -fPIC \
-ffunction-sections -fdata-sections
LINUXLDFLAGS = -fPIC -shared -static \
-Wl,-export-dynamic \
-nostartfiles -nodefaultlibs -nostdlib \
-Wl,--gc-sections
LINUXINCLUDE = -I$(SRC_DIR)
#--- mac
DARWINCFLAGS = -DPD -O3 -Wall -W -Wshadow \
-Wno-unused -Wno-parentheses -Wno-switch \
-fcheck-new -fvisibility=hidden
DARWINLDFLAGS = -bundle -undefined suppress -flat_namespace
DARWININCLUDE = -I./include -I../src
#--- windows
WINCFLAGS = -msse -DPD -DMSW -Werror -Wno-unused -mms-bitfields\
-Wno-parentheses -Wno-switch -O6 -funroll-loops -fomit-frame-pointer\
-fno-strict-aliasing -fcheck-new
WINLDFLAGS = -static-libgcc -static-libstdc++ --export-dynamic -shared
WININCLUDE = -I ./include
ifeq ($(EXTENSION),pd_linux)
INCLUDE = $(LINUXINCLUDE)
CFLAGS = $(LINUXCFLAGS)
LDFLAGS = $(LINUXLDFLAGS)
else
ifeq ($(EXTENSION),pd_darwin)
INCLUDE = $(DARWININCLUDE)
CFLAGS = $(DARWINCFLAGS)
LDFLAGS = $(DARWINLDFLAGS)
endif
endif