-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (41 loc) · 1.35 KB
/
Makefile
File metadata and controls
55 lines (41 loc) · 1.35 KB
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
#!/usr/bin/env make
STRIP = strip
RESULT = pdfontloader.dll
SOURCES = pdfontloader.c
TCL_VERSION = 8.6
TCL_INCLUDE = /usr/include/tcl$(TCL_VERSION)
TCL_LIB = /usr/lib
TCL_CFLAGS = -I$(TCL_INCLUDE)
TCL_LIBS = -L$(TCL_LIB) -ltclstub$(subst .,,$(TCL_VERSION))
have_tclpkg=$(shell pkg-config --exists tcl$(TCL_VERSION) && echo true)
ifeq ($(have_tclpkg), true)
TCL_CFLAGS=$(shell pkg-config --cflags tcl$(TCL_VERSION))
TCL_LIBS=$(shell pkg-config --libs tcl$(TCL_VERSION))
endif
# build for Tcl 8.5.10 distributed with Pd,
# use local tcl headers as the headers are *not* with Pd
ifneq ($(PDDIR),)
TCL_CFLAGS=-Ilibs/tcl/include
TCL_LIB_VERSION = 85
# the headers are 8.5, but let's just search for any tclstub, and hope it is compatible
TCL_LIB_VERSION = *
TCL_LIBS=$(firstword $(wildcard $(PDDIR)/bin/libtclstub$(TCL_LIB_VERSION).a $(PDDIR)/lib/libtclstub$(TCL_LIB_VERSION).a))
endif
CFLAGS += -DUSE_TCL_STUBS $(TCL_CFLAGS)
LDFLAGS = $(TCL_LIBS) -lgdi32
.PHONY: strip clean
all: $(RESULT)
$(RESULT): $(SOURCES)
$(CC) -Wall -shared -o $(RESULT) $(CFLAGS) $^ $(LDFLAGS)
strip: $(RESULT)
$(STRIP) $(RESULT)
clean:
rm -rf $(RESULT)
test:
@echo TCL_CFLAGS: $(TCL_CFLAGS)
@echo TCL_LIBS: $(TCL_LIBS)
@echo CFLAGS: $(CFLAGS)
@echo LDFLAGS: $(LDFLAGS)
@echo ""
@echo TCL_VERSION = $(TCL_VERSION)
@echo "TCL_INCLUDE: $(TCL_INCLUDE) -> $(wildcard $(TCL_INCLUDE))"