new mirror
[hband-tools.git] / lib / libarray / Makefile
blobf93c39bdee8b79b0b93f91d73a37b96a55d9263b
2 LIBDIR = /usr/lib/tool
3 OLDINCLUDEDIR = /usr/include/tool
5 override CFLAGS += -lmallocab -Wl,-rpath=$(LIBDIR)
8 libarray.so: libarray.c libarray.h
9 $(CC) $(CFLAGS) -o $@ -shared libarray.c
11 $(LIBDIR)/libarray.so: libarray.so
12 install -m 0644 $(notdir $@) $(LIBDIR)/
13 @echo remove $@ >> uninstall.sh
15 $(OLDINCLUDEDIR)/libarray.h: libarray.h | $(OLDINCLUDEDIR)
16 install -m 0644 $(notdir $@) $(OLDINCLUDEDIR)/
17 @echo remove $@ >> uninstall.sh
19 $(OLDINCLUDEDIR):
20 [ -d $(OLDINCLUDEDIR) ] || mkdir $(OLDINCLUDEDIR)
21 @echo remove $@ >> uninstall.sh
23 install: $(LIBDIR)/libarray.so $(OLDINCLUDEDIR)/libarray.h
24 ldconfig
25 .PHONY: install
27 clean:
28 @rm libarray.so t_libarray
29 .PHONY: clean
31 t_libarray: t_libarray.c
32 $(CC) $(CFLAGS) -o $@ t_libarray.c
34 test: t_libarray
35 ./t_libarray
36 .PHONY: test