1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
|
From: =?utf-8?q?IOhannes_m_zm=C3=B6lnig?= <umlaeute@debian.org>
Date: Mon, 5 Feb 2024 21:55:07 +0100
Subject: Fix Makefile to allow compiling libpd example
Origin: Debian
Forwarded: not-needed
Last-Update: 2023-07-05
Last-Update: 2023-07-05
---
libpd/test_libpd/Makefile | 79 ++++++-----------------------------------------
1 file changed, 10 insertions(+), 69 deletions(-)
--- puredata.orig/libpd/test_libpd/Makefile
+++ puredata/libpd/test_libpd/Makefile
@@ -1,86 +1,27 @@
-# This is a makefile to build "test_libpd". It assumes that libpd is in the
-# source directory "../" and that libpd is already built.
-
-# detect platform
-UNAME = $(shell uname)
-SOLIB_PREFIX = lib
-
-ifeq ($(UNAME), Darwin) # Mac
- SOLIB_EXT = dylib
- STATICLIB_EXT = a
- PLATFORM = mac
-else
- ifeq ($(OS), Windows_NT) # Windows, use Mingw
- SOLIB_PREFIX =
- SOLIB_EXT = dll
- STATICLIB_EXT = lib
- PLATFORM = windows
- else # assume Linux
- SOLIB_EXT = so
- STATICLIB_EXT = a
- PLATFORM = linux
- endif
-endif
-
-PD_DIR = ../..
-LIBPD_DIR = ..
-LIBPD = $(SOLIB_PREFIX)pd.$(SOLIB_EXT)
-LIBPD_STATIC = $(LIBPD_DIR)/libpd.$(STATICLIB_EXT)
-
+# This is a makefile to build "test_libpd".
SRC_FILES = test_libpd.c
TARGET = test_libpd
-CFLAGS = -I$(PD_DIR)/src -O3
-
-.PHONY: libs clean-libs clean clobber
-
+.PHONY: all
all: $(TARGET)
-##### libs
-
-# build libpd and move a copy here
-$(LIBPD):
- make -C $(LIBPD_DIR)
- cp $(LIBPD_DIR)/$(LIBPD) .
-
-# on windows, copy libpd and MinGW winpthread dll to here
-ifeq ($(PLATFORM), windows)
-
-LDFLAGS = $(LIBPD)
-
-PTHREAD_DIR = ${MINGW_PREFIX}/bin
-PTHREAD = libwinpthread-1.dll
-
-$(PTHREAD):
- cp $(PTHREAD_DIR)/$(PTHREAD) .
-
-libs: $(LIBPD) $(PTHREAD)
-
-clean-libs:
- rm -f $(LIBPD) $(PTHREAD)
-
-# mac & linux
-else
-
# force static linking? make STATIC=true
ifeq ($(STATIC), true)
-LDFLAGS = $(LIBPD_STATIC)
+LDFLAGS += -l:libpd.a -lm
else # copy libpd to here by default
-LDFLAGS = $(LIBPD)
-libs: $(LIBPD)
+LDFLAGS += -lpd
endif
-clean-libs:
- rm -f $(LIBPD)
-
-endif
+LDFLAGS += -lc
+CPPFLAGS += -I/usr/include/pd
##### target
-$(TARGET): ${SRC_FILES:.c=.o} libs
- $(CC) -o $@ ${SRC_FILES:.c=.o} $(LDFLAGS)
+$(TARGET): ${SRC_FILES:.c=.o}
+ $(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
##### clean
-clean: clean-libs
+.PHONY: clean
+clean:
rm -f $(TARGET) *.o
|