Mercurial > pub > dyncall > dyncall
annotate test/dynload_plain/Makefile.generic @ 308:7c6f19d42b31
dynload UTF-8 support for library paths:
- added missing support to windows
- added test code for all platforms to dynload_plain
- doc update
author | Tassilo Philipp |
---|---|
date | Thu, 24 Oct 2019 23:19:20 +0200 |
parents | 483581921af2 |
children | 73b5b9e224e2 |
rev | line source |
---|---|
272
a94a9a83dae6
- dynload_plain test handling symbol aliases, now
Tassilo Philipp
parents:
214
diff
changeset
|
1 # path to default libc.so file, easier to do via shell than in code (see main() in dynload_plain.c) |
273 | 2 # for compat: first gmake style, then assignment op which will use ! as part of var name on gmake<4 |
3 # and thus not override previously set var | |
285
483581921af2
- dynload_plain test: better guessing what .so to use
Tassilo Philipp
parents:
274
diff
changeset
|
4 DEF_C_DYLIB=$(shell ((ls /lib*/libc.so* || ls /usr/lib/libc.so*) | grep -v '\.a$$' | (sort -V -r || sort -t . -n -k 2)) 2>/dev/null | head -1) |
483581921af2
- dynload_plain test: better guessing what .so to use
Tassilo Philipp
parents:
274
diff
changeset
|
5 DEF_C_DYLIB!=((ls /lib*/libc.so* || ls /usr/lib/libc.so*) | grep -v '\.a$$' | (sort -V -r || sort -t . -n -k 2)) 2>/dev/null | head -1 |
272
a94a9a83dae6
- dynload_plain test handling symbol aliases, now
Tassilo Philipp
parents:
214
diff
changeset
|
6 |
308 | 7 APP = dynload_plain |
8 OBJS = dynload_plain.o | |
9 TEST_U8_SO = dynload_plain_ß_test # @@@ unsure if every platform handles ß, here (ANSI, UTF-8, ...) | |
10 SRCTOP = ${VPATH}/../.. | |
11 BLDTOP = ../.. | |
12 CFLAGS += -I${SRCTOP}/dynload -DDEF_C_DYLIB=\"${DEF_C_DYLIB}\" | |
13 LDLIBS_D += -L${BLDTOP}/dynload -ldynload_s | |
272
a94a9a83dae6
- dynload_plain test handling symbol aliases, now
Tassilo Philipp
parents:
214
diff
changeset
|
14 |
214 | 15 # Works on: Darwin, NetBSD. |
16 # Linux: add '-ldl' | |
17 .PHONY: all clean install | |
308 | 18 all: ${APP} ${TEST_U8_SO} |
214 | 19 ${APP}: ${OBJS} |
272
a94a9a83dae6
- dynload_plain test handling symbol aliases, now
Tassilo Philipp
parents:
214
diff
changeset
|
20 ${CC} ${LDFLAGS} ${OBJS} ${LDLIBS_D} ${LDLIBS} -o ${APP} |
308 | 21 ${TEST_U8_SO}: |
22 echo 'int dynload_plain_testfunc() { return 5; }' | ${CC} -shared -x c - -o ${TEST_U8_SO} | |
214 | 23 clean: |
308 | 24 rm -f ${APP} ${OBJS} ${TEST_U8_SO} |
214 | 25 install: |
26 mkdir -p ${PREFIX}/test | |
308 | 27 cp ${APP} ${TEST_U8_SO} ${PREFIX}/test |
214 | 28 |