Source

pyd / examples / misc / dmd_sharedlibs / makefile

# ###########################################################
BITSI = 
ifeq ($(BITSI), 32)
DMD_M=-m32
GCC_M=-m32
else	
ifeq ($(BITSI), 64)
DMD_M=-m64
GCC_M=-m64
else
DMD_M=
GCC_M=
endif
endif
DMD=dmd $(DMD_M)
GCC=gcc $(GCC_M)


# build a shared lib with d, link to it from c.
test1: test1.x libtest1.so
	LD_LIBRARY_PATH=. ./test1.x
# build two shared libs with d, link to both from c.
test2: test2.x libtest2a.so libtest2b.so
	LD_LIBRARY_PATH=. ./test2.x
test3: test3.x libtest3.so
	LD_LIBRARY_PATH=. ./test3.x
clean:
	rm -f *.o
	rm -f *.so
	rm -f *.x

lib%.so: %.d boilerplate.d test1helper.o 
	$(DMD) -unittest -fPIC -shared $^ -of$@
test1helper.o: test1helper.c
	$(GCC) -c test1helper.c -o test1helper.o

test1.x: test1.c libtest1.so
	LD_LIBRARY_PATH=. $(GCC) $< -L. -ltest1 -o $@
test2.x: test2.c libtest2a.so libtest2b.so
	LD_LIBRARY_PATH=. $(GCC) $< -L. -ltest2a -ltest2b -o $@
test3.x: test3.d libtest3.so
	LD_LIBRARY_PATH=. dmd $< -L-L. -L-ltest3 -of$@ 
libtest3.so: test3lib.c
	gcc -fPIC -shared $< -o $@

# ###########################################################
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.