1. ariovistus
  2. pyd

Source

pyd / examples / misc / ldc_sharedlibs / Tupfile

include_rules

ifeq (@(TUP_PLATFORM),win32)
# Windows not supported by LDC
else
# Linuxen

LDC = ldc2
LIBS= -Wl,--no-as-needed -lphobos-ldc -ldruntime-ldc -lrt -lpthread -ldl -lm -lpython2.7

!link_lib = | boilerplate.o |> gcc -nostartfiles -shared $(LIBS) %f boilerplate.o -o %o |> lib%B.so

: foreach *.d |> $(LDC) -relocation-model=pic -c %f -of %o |> %B.o
: test1.o |> !link_lib |> 
: test2a.o |> !link_lib |> 
: test2b.o |> !link_lib |>
: test1.c libtest1.so |> gcc test1.c $(TUP_CWD)/libtest1.so -o %o |> test1.x
: test2.c libtest2a.so libtest2b.so |> gcc test2.c $(TUP_CWD)/libtest2a.so $(TUP_CWD)/libtest2b.so -o %o |> test2.x

: test3lib.c |> gcc -fPIC -shared %f -o %o |> libtest3.so

: test3.o libtest3.so |> $(LDC) test3.o -L$(TUP_CWD)/libtest3.so -of %o |> test3.x

endif