# This is a makefile to build "test_libpd".
SRC_FILES = test_libpd.c
TARGET = test_libpd

.PHONY: all
all: $(TARGET)

# force static linking? make STATIC=true
ifeq ($(STATIC), true)
LDFLAGS += -l:libpd.a -lm
else # copy libpd to here by default
LDFLAGS += -lpd
endif

LDFLAGS += -lc
CPPFLAGS += -I/usr/include/pd

##### target

$(TARGET): ${SRC_FILES:.c=.o}
	$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)

##### clean

.PHONY: clean
clean:
	rm -f $(TARGET) *.o
