diff --git a/GNUmakefile b/GNUmakefile index 80c718ae..60646410 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -181,14 +181,14 @@ $(wildcard tests/perf/pqu/perf*.cc?) : $(COMMON_H) ctl/priority_queue.h $(wildcard tests/perf/vec/perf*.cc?) : $(COMMON_H) ctl/vector.h $(wildcard tests/perf/uset/perf*.cc?): $(COMMON_H) ctl/unordered_set.h $(wildcard tests/perf/str/perf*.cc?): $(COMMON_H) ctl/string.h ctl/vector.h -$(wildcard tests/perf/arr/*.cc?): $(COMMON_H) ctl/array.h +$(wildcard tests/perf/arr/gen*.cc?): $(COMMON_H) ctl/array.h -tests/perf/arr/gen_array0% : tests/perf/arr/gen_array0%.c \ +tests/perf/arr/gen_array0% : tests/perf/arr/gen_array0%.cc \ tests/perf/arr/perf_arr_generate .cflags $(COMMON_H) ctl/array.h - @$(CC) $(CFLAGS) -o $@ $@.c -tests/perf/arr/gen_arr0% : tests/perf/arr/gen_arr0%.cc \ + @$(CXX) $(CXXFLAGS) -o $@ $@.cc +tests/perf/arr/gen_arr0% : tests/perf/arr/gen_arr0%.c \ tests/perf/arr/perf_arr_generate .cflags $(COMMON_H) ctl/array.h - @$(CXX) $(CFLAGS) -o $@ $@.c + @$(CC) $(CFLAGS) -o $@ $@.c compile_commands.json : $(H) GNUmakefile make clean; bear make @@ -231,8 +231,12 @@ docs/index.md : README.md ./update-index.pl ./update-index.pl man: docs/man/ctl.h.3 $(MANPAGES) + -rm docs/man/index.h.3 + -rm docs/man/memory.h.3 + -rm docs/man/numeric.h.3 RONN_ARGS=--manual "CTL Manual $(VERSION)" --organization=rurban/ctl +# FIXME docs/man/ctl.h.3: docs/index.md @mkdir -p docs/man ronn $(RONN_ARGS) < $< > $@ @@ -241,17 +245,6 @@ docs/man/%.h.3 : docs/%.md @mkdir -p docs/man ronn $(RONN_ARGS) < $< > $@ -install: man - -rm docs/man/index.h.3 - mkdir -p $(DESTDIR)$(PREFIX)/include/ctl/bits - cp ctl/*.h $(DESTDIR)$(PREFIX)/include/ctl/ - cp ctl/bits/*.h $(DESTDIR)$(PREFIX)/include/ctl/bits/ - mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3 - cp docs/man/* $(DESTDIR)$(PREFIX)/share/man/man3/ - mkdir -p $(DESTDIR)$(PREFIX)/share/doc/ctl/images - cp docs/*.md $(DESTDIR)$(PREFIX)/share/doc/ctl/ - cp docs/images/*.log.png $(DESTDIR)$(PREFIX)/share/doc/ctl/images/ - clean: @rm -f .cflags .cflags.tmp @rm -f $(TESTS) @@ -406,17 +399,30 @@ dist: man tar cfJ ctl-${VERSION}.tar.xz ctl-${VERSION} rm -rf ctl-${VERSION} +install: man + -rm docs/man/index.h.3 + -rm docs/man/memory.h.3 + -rm docs/man/numeric.h.3 + mkdir -p $(DESTDIR)$(PREFIX)/include/ctl/bits + cp ctl/*.h $(DESTDIR)$(PREFIX)/include/ctl/ + cp ctl/bits/*.h $(DESTDIR)$(PREFIX)/include/ctl/bits/ + mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3 + cp docs/man/* $(DESTDIR)$(PREFIX)/share/man/man3/ + mkdir -p $(DESTDIR)$(PREFIX)/share/doc/ctl/images + cp docs/*.md $(DESTDIR)$(PREFIX)/share/doc/ctl/ + cp docs/images/*.log.png $(DESTDIR)$(PREFIX)/share/doc/ctl/images/ + # emacs flymake-mode check-syntax: case "$(CHK_SOURCES)" in \ - *.c) \ - nice $(CC) $(CFLAGS) -O0 -c ${CHK_SOURCES} ;; \ - *.cc) \ - nice $(CXX) $(CXXFLAGS) -O0 -c ${CHK_SOURCES} ;; \ ctl/bits/*.h) \ nice $(CXX) $(CXXFLAGS) -O0 -c tests/func/test_vector ;; \ ctl/*.h) \ nice $(CXX) $(CXXFLAGS) -O0 -c tests/func/test_$(subst .h,.cc,$(subst ctl/,,${CHK_SOURCES})) ;; \ + *.c) \ + nice $(CC) $(CFLAGS) -O0 -c ${CHK_SOURCES} ;; \ + *.cc) \ + nice $(CXX) $(CXXFLAGS) -O0 -c ${CHK_SOURCES} ;; \ esac .PHONY: check-syntax diff --git a/makefile b/makefile index 4e3c83dd..ae2df6a2 100644 --- a/makefile +++ b/makefile @@ -151,7 +151,11 @@ PERFS_C = ${patsubst %.c,%, ${wildcard tests/perf/*/perf*.c} \ PERFS_CC = ${patsubst %.cc,%, ${wildcard tests/perf/*/perf*.cc} \ $(wildcard tests/perf/arr/gen_*.cc) tests/perf/perf_compile_cc.cc} -perf: ${PERFS_C} ${PERFS_CC} +perf: ${PERFS_C} ${PERFS_CC} tests/perf/arr/perf_arr_generate + +tests/perf/arr/perf_arr_generate: tests/perf/arr/perf_arr_generate.c + $(CC) $(CFLAGS) -o $@ $@.c + tests/perf/arr/perf_arr_generate ${wildcard tests/perf/lst/perf*.cc?} : ${COMMON_H} ctl/list.h ${wildcard tests/perf/set/perf*.cc?} : ${COMMON_H} ctl/set.h @@ -159,7 +163,7 @@ ${wildcard tests/perf/deq/perf*.cc?} : ${COMMON_H} ctl/deque.h ${wildcard tests/perf/pqu/perf*.cc?} : ${COMMON_H} ctl/priority_queue.h ${wildcard tests/perf/vec/perf*.cc?} : ${COMMON_H} ctl/vector.h ${wildcard tests/perf/uset/perf*.cc?}: ${COMMON_H} ctl/unordered_set.h -${wildcard tests/perf/arr/gen*.cc?}: ${COMMON_H} ctl/unordered_set.h +${wildcard tests/perf/arr/gen*.cc?}: ${COMMON_H} ctl/array.h ${wildcard tests/perf/str/perf*.cc?} : ${COMMON_H} ctl/vector.h ctl/string.h examples: ${EXAMPLES} @@ -174,29 +178,23 @@ README.md: ${wildcard tests/func/test_*.cc} docs/index.md : README.md ./update-index.pl +RONN_ARGS=--manual "CTL Manual $(VERSION)" --organization=rurban/ctl +# FIXME docs/man/ctl.h.3: docs/index.md @mkdir -p docs/man - ronn --manual "CTL Manual ${VERSION}" --organization=rurban/ctl < $< > $@ + ronn ${RONN_ARGS} < $< > $@ + docs/man/%.h.3 : docs/%.md @mkdir -p docs/man - ronn --manual "CTL Manual ${VERSION}" --organization=rurban/ctl < $< > $@ - -install: man - -rm docs/man/index.h.3 - mkdir -p $(DESTDIR)$(PREFIX)/include/ctl/bits - cp ctl/*.h $(DESTDIR)$(PREFIX)/include/ctl/ - cp ctl/bits/*.h $(DESTDIR)$(PREFIX)/include/ctl/bits/ - mkdir -p ${DESTDIR)${PREFIX)/share/man/man3 - cp docs/man/* ${DESTDIR)${PREFIX)/share/man/man3/ - mkdir -p ${DESTDIR)${PREFIX)/share/doc/ctl/images - cp docs/*.md ${DESTDIR)${PREFIX)/share/doc/ctl/ - cp docs/images/*.log.png ${DESTDIR)${PREFIX)/share/doc/ctl/images/ + ronn ${RONN_ARGS} < $< > $@ clean: @rm -f .cflags .cflags.tmp @rm -f ${TESTS} @rm -f ${EXAMPLES} - @rm -f ${PERFS_C} ${PERFS_CC} + @rm -f ${PERFS_C} ${PERFS_CC} ${VERIFIY} + @rm -f tests/perf/arr/perf_arr_generate + @rm -f tests/perf/*.log @rm -f docs/man/ctl.h.3 ${MANPAGES} @if test -d docs/man; then rmdir docs/man; fi @@ -380,6 +378,19 @@ dist: man tar cfJ ctl-${VERSION}.tar.xz ctl-${VERSION} rm -rf ctl-${VERSION} +install: man + -rm docs/man/index.h.3 + -rm docs/man/memory.h.3 + -rm docs/man/numeric.h.3 + mkdir -p $(DESTDIR)$(PREFIX)/include/ctl/bits + cp ctl/*.h $(DESTDIR)$(PREFIX)/include/ctl/ + cp ctl/bits/*.h $(DESTDIR)$(PREFIX)/include/ctl/bits/ + mkdir -p ${DESTDIR)${PREFIX)/share/man/man3 + cp docs/man/* ${DESTDIR)${PREFIX)/share/man/man3/ + mkdir -p ${DESTDIR)${PREFIX)/share/doc/ctl/images + cp docs/*.md ${DESTDIR)${PREFIX)/share/doc/ctl/ + cp docs/images/*.log.png ${DESTDIR)${PREFIX)/share/doc/ctl/images/ + ALWAYS: # \