From 90cffdf4fb11187b2f2e003fa8e94e45ef3ad19e Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Thu, 29 Mar 2012 19:40:28 -0400 Subject: [PATCH] doc: Initial support for manual pages, pending portability concerns. I must update this for Solaris. --- Makefile.in | 19 +++++++++++++--- build/ck.spec.in | 7 +++++- configure | 6 +++++ doc/Makefile | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 doc/Makefile diff --git a/Makefile.in b/Makefile.in index 8bcc50c..43964c1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -.PHONY: all clean distribution regressions install install-headers uninstall +.PHONY: all clean distribution regressions install install-headers install-doc uninstall doc CFLAGS=@CFLAGS@ VERSION=@VERSION@ @@ -7,13 +7,18 @@ PREFIX=@PREFIX@ LIBRARY=@LIBRARY@ HEADERS=@HEADERS@ PKGCONFIG_DATA=@LIBRARY@/pkgconfig +MANDIR=@MANDIR@ -all: +all: doc $(MAKE) -C src all || exit @echo @echo @echo ---[ Concurrency Kit has built successfully. You may now \"make install\". +doc: + $(MAKE) -C doc all || exit + @echo ---[ Manual pages are ready for installation. + regressions: $(MAKE) -C regressions all || exit @echo ---[ Regressions have built successfully. @@ -27,7 +32,11 @@ install-headers: chmod 755 $(DESTDIR)/$(HEADERS)/gcc chmod 644 $(DESTDIR)/$(HEADERS)/gcc/ck_*.h $(DESTDIR)/$(HEADERS)/gcc/*/ck_*.h || exit -install: all install-headers +install-doc: doc + mkdir -p $(MANDIR)/man3 || exit + cp doc/*.3.gz $(MANDIR)/man3 || exit + +install: all install-headers install-doc mkdir -p $(DESTDIR)/$(LIBRARY) || exit cp src/libck.so $(DESTDIR)/$(LIBRARY)/libck.so.$(VERSION) || exit ln -s libck.so.$(VERSION) $(DESTDIR)/$(LIBRARY)/libck.so @@ -38,6 +47,9 @@ install: all install-headers cp build/ck.pc $(DESTDIR)/$(PKGCONFIG_DATA)/ck.pc || exit cp src/libck.a $(DESTDIR)/$(LIBRARY)/libck.a || exit chmod 644 $(DESTDIR)/$(LIBRARY)/libck.a || exit + @echo + @echo + @echo ---[ Concurrency Kit has installed successfully. uninstall: rm -f $(DESTDIR)/$(LIBRARY)/libck.so* @@ -48,6 +60,7 @@ uninstall: rm -f $(DESTDIR)/$(PKGCONFIG_DATA)/ck.pc clean: + $(MAKE) -C doc clean $(MAKE) -C src clean $(MAKE) -C regressions clean rm -f *~ *.o diff --git a/build/ck.spec.in b/build/ck.spec.in index 0c3c7f5..2dc2e59 100644 --- a/build/ck.spec.in +++ b/build/ck.spec.in @@ -37,7 +37,11 @@ resources needed for developing Concurrency Kit applications. %setup -q %build -CFLAGS=$RPM_OPT_FLAGS ./configure --libdir=%{_libdir} --includedir=%{_includedir}/%{name} --prefix=%{_prefix} +CFLAGS=$RPM_OPT_FLAGS ./configure \ + --libdir=%{_libdir} \ + --includedir=%{_includedir}/%{name} \ + --mandir=%{_mandir} \ + --prefix=%{_prefix} make %{?_smp_mflags} %install @@ -60,6 +64,7 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/%{name}/*/*/*.h %{_libdir}/libck.a %{_libdir}/pkgconfig/%{name}.pc +%{_mandir}/man3/*.3.gz %post /sbin/ldconfig diff --git a/configure b/configure index 0604087..68b0076 100755 --- a/configure +++ b/configure @@ -88,6 +88,7 @@ generate() -e "s#@LD@#$LD#g" \ -e "s#@LDFLAGS@#$LDFLAGS#g" \ -e "s#@PTHREAD_CFLAGS@#$PTHREAD_CFLAGS#g" \ + -e "s#@MANDIR@#$MANDIR#g" \ $1 > $2 } @@ -105,6 +106,7 @@ generate_stdout() echo echo "Headers will be installed in $HEADERS" echo "Libraries will be installed in $LIBRARY" + echo "Documentation will be installed in $MANDIR" } for option in $*; do @@ -141,6 +143,9 @@ for option in $*; do --libdir=*) LIBRARY=$value ;; + --mandir=*) + MANDIR=$value + ;; *) echo "./configure [--help]" exit $EXIT_FAILURE @@ -150,6 +155,7 @@ done HEADERS=${HEADERS:-"${PREFIX}/include"} LIBRARY=${LIBRARY:-"${PREFIX}/lib"} +MANDIR=${MANDIR:-"${PREFIX}/man"} if test "$PROFILE"; then printf "Using user-specified profile....." diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..f9784c7 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,57 @@ +.PHONY: all clean + +GZIP=gzip +OBJECTS=ck_ht_allocator_set.3.gz \ + ck_ht_count.3.gz \ + ck_ht_destroy.3.gz \ + ck_ht_get_spmc.3.gz \ + ck_ht_grow_spmc.3.gz \ + ck_ht_hash.3.gz \ + ck_ht_hash_direct.3.gz \ + ck_ht_init.3.gz \ + ck_ht_put_spmc.3.gz \ + ck_ht_remove_spmc.3.gz \ + ck_ht_reset_spmc.3.gz \ + ck_ht_set_spmc.3.gz + +all: $(OBJECTS) + +ck_ht_allocator_set.3.gz: ck_ht_allocator_set.3 + $(GZIP) -c ck_ht_allocator_set.3 > ck_ht_allocator_set.3.gz + +ck_ht_count.3.gz: ck_ht_count.3 + $(GZIP) -c ck_ht_count.3 > ck_ht_count.3.gz + +ck_ht_destroy.3.gz: ck_ht_destroy.3 + $(GZIP) -c ck_ht_destroy.3 > ck_ht_destroy.3.gz + +ck_ht_get_spmc.3.gz: ck_ht_get_spmc.3 + $(GZIP) -c ck_ht_get_spmc.3 > ck_ht_get_spmc.3.gz + +ck_ht_grow_spmc.3.gz: ck_ht_grow_spmc.3 + $(GZIP) -c ck_ht_grow_spmc.3 > ck_ht_grow_spmc.3.gz + +ck_ht_hash.3.gz: ck_ht_hash.3 + $(GZIP) -c ck_ht_hash.3 > ck_ht_hash.3.gz + +ck_ht_hash_direct.3.gz: ck_ht_hash_direct.3 + $(GZIP) -c ck_ht_hash_direct.3 > ck_ht_hash_direct.3.gz + +ck_ht_init.3.gz: ck_ht_init.3 + $(GZIP) -c ck_ht_init.3 > ck_ht_init.3.gz + +ck_ht_put_spmc.3.gz: ck_ht_put_spmc.3 + $(GZIP) -c ck_ht_put_spmc.3 > ck_ht_put_spmc.3.gz + +ck_ht_remove_spmc.3.gz: ck_ht_remove_spmc.3 + $(GZIP) -c ck_ht_remove_spmc.3 > ck_ht_remove_spmc.3.gz + +ck_ht_reset_spmc.3.gz: ck_ht_reset_spmc.3 + $(GZIP) -c ck_ht_reset_spmc.3 > ck_ht_reset_spmc.3.gz + +ck_ht_set_spmc.3.gz: ck_ht_set_spmc.3 + $(GZIP) -c ck_ht_set_spmc.3 > ck_ht_set_spmc.3.gz + +clean: + rm -f *~ *.o *.3.gz +