Skip to content

Commit

Permalink
Release ctl-202102
Browse files Browse the repository at this point in the history
  • Loading branch information
rurban committed Feb 22, 2021
1 parent 242540d commit bcbebf3
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 36 deletions.
46 changes: 26 additions & 20 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@ [email protected]
@$(CC) $(CFLAGS) -o $@ [email protected]

compile_commands.json : $(H) GNUmakefile
make clean; bear make
Expand Down Expand Up @@ -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) < $< > $@
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
43 changes: 27 additions & 16 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,19 @@ 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
${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}
Expand All @@ -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

Expand Down Expand Up @@ -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:

# \
Expand Down

0 comments on commit bcbebf3

Please sign in to comment.