~rcr/rirc

1f8793cf7740154be10d85688737dc49ad8d3748 — Richard Robbins 8 months ago 281a93e
fix build
M .builds/compat/debian.yml => .builds/compat/debian.yml +2 -2
@@ 10,10 10,10 @@ sources:
tasks:
  - build: |
      cd rirc
      MAKEFLAGS='-j $(nproc)' make all
      MAKEFLAGS="-j $(nproc)" make all
  - check: |
      cd rirc
      MAKEFLAGS='-j $(nproc)' make check
      MAKEFLAGS="-j $(nproc)" make check

triggers:
  - action: email

M .builds/compat/fedora.yml => .builds/compat/fedora.yml +2 -2
@@ 10,10 10,10 @@ sources:
tasks:
  - build: |
      cd rirc
      MAKEFLAGS='-j $(nproc)' make all
      MAKEFLAGS="-j $(nproc)" make all
  - check: |
      cd rirc
      MAKEFLAGS='-j $(nproc)' make check
      MAKEFLAGS="-j $(nproc)" make check

triggers:
  - action: email

M .builds/compat/freebsd.yml => .builds/compat/freebsd.yml +2 -2
@@ 11,10 11,10 @@ sources:
tasks:
  - build: |
      cd rirc
      MAKEFLAGS='-j $(nproc)' gmake all
      MAKEFLAGS="-j $(nproc)" gmake all
  - check: |
      cd rirc
      MAKEFLAGS='-j $(nproc)' gmake check
      MAKEFLAGS="-j $(nproc)" gmake check

triggers:
  - action: email

M .builds/compat/openbsd.yml => .builds/compat/openbsd.yml +2 -2
@@ 11,10 11,10 @@ sources:
tasks:
  - build: |
      cd rirc
      MAKEFLAGS='-j $(nproc)' gmake all
      MAKEFLAGS="-j $(nproc)" gmake all
  - check: |
      cd rirc
      MAKEFLAGS='-j $(nproc)' gmake check
      MAKEFLAGS="-j $(nproc)" gmake check

triggers:
  - action: email

M .builds/dev.yml => .builds/dev.yml +2 -2
@@ 15,10 15,10 @@ secrets:
tasks:
  - build: |
      cd rirc
      MAKEFLAGS='-j $(nproc)' make all
      MAKEFLAGS="-j $(nproc)" make all
  - check: |
      cd rirc
      MAKEFLAGS='-j $(nproc)' make check
      MAKEFLAGS="-j $(nproc)" make check
  - static-analysis: |
      cd rirc
      [ $(git name-rev --name-only HEAD) = "remotes/origin/static_analysis" ] || complete-build

M Makefile => Makefile +6 -4
@@ 14,6 14,8 @@ DIR_S := src
DIR_L := lib
DIR_T := test

CONFIG := config.h

include lib/mbedtls.Makefile

CFLAGS ?= -O2 -flto


@@ 57,19 59,19 @@ $(BIN_D): $(MBEDTLS_LIBS) $(OBJS_G) $(OBJS_D)
	@$(CC) $(LDFLAGS) -o $@ $(OBJS_D) $(MBEDTLS_LIBS)

# Release build objects
$(DIR_B)/%.o: $(DIR_S)/%.c | $(DIR_B)
$(DIR_B)/%.o: $(DIR_S)/%.c $(CONFIG) | $(DIR_B)
	@echo "  CC    $<"
	@$(CPP) $(CFLAGS) $(CFLAGS_LOCAL) -MM -MP -MT $@ -MF $(@:.o=.o.d) $<
	@$(CC)  $(CFLAGS) $(CFLAGS_LOCAL) -c -o $@ $<

# Debug build objects
$(DIR_B)/%.db.o: $(DIR_S)/%.c | $(DIR_B)
$(DIR_B)/%.db.o: $(DIR_S)/%.c $(CONFIG) | $(DIR_B)
	@echo "  CC    $<"
	@$(CPP) $(CFLAGS_DEBUG) $(CFLAGS_LOCAL) -MM -MP -MT $@ -MF $(@:.o=.o.d) $<
	@$(CC)  $(CFLAGS_DEBUG) $(CFLAGS_LOCAL) -c -o $@ $<

# Testcases
$(DIR_B)/%.t: $(DIR_T)/%.c $(OBJS_G) | $(DIR_B)
$(DIR_B)/%.t: $(DIR_T)/%.c $(OBJS_G) $(CONFIG) | $(DIR_B)
	@$(CPP) $(CFLAGS_DEBUG) $(CFLAGS_LOCAL) -MM -MP -MT $@ -MF $(@:.t=.t.d) $<
	@$(CC)  $(CFLAGS_DEBUG) $(CFLAGS_LOCAL) -c -o $(@:.t=.t.o) $<
	@$(CC)  $(CFLAGS_DEBUG) $(CFLAGS_LOCAL) -o $@ $(@:.t=.t.o)


@@ 80,7 82,7 @@ $(DIR_B)/%.t: $(DIR_T)/%.c $(OBJS_G) | $(DIR_B)
$(DIR_B):
	@for dir in $(patsubst $(DIR_S)/%, $(DIR_B)/%, $(SUBDIRS)); do mkdir -p $$dir; done

config.h:
$(CONFIG):
	cp config.def.h config.h

%.gperf.out: %.gperf

M lib/mbedtls.Makefile => lib/mbedtls.Makefile +1 -1
@@ 19,7 19,7 @@ $(MBEDTLS_LIBS): $(MBEDTLS_CFG) $(MBEDTLS_SRC)
$(MBEDTLS_SRC): $(MBEDTLS_SHA)
	@echo "curl $(MBEDTLS_TAR)..."
	@curl -LfsS $(MBEDTLS_URL) -o $(MBEDTLS_TAR)
	@shasum -a 256 -q --check $(MBEDTLS_SHA)
	@sha256sum --quiet --check $(MBEDTLS_SHA)
	@tar -xmf $(MBEDTLS_TAR) --directory $(DIR_L)

$(MBEDTLS_SHA):