mk: C++17
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
name: build
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -8,18 +11,19 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get install libboost-dev libboost-program-options-dev
|
||||
sudo apt-get install -y --no-install-recommends libboost-dev libboost-program-options-dev
|
||||
- name: check code style
|
||||
run: |
|
||||
make lint
|
||||
[[ $(git status --porcelain | tee >(cat 1>&2) | wc -l) -eq 0 ]]
|
||||
git diff --exit-code
|
||||
- name: build and install
|
||||
run: |
|
||||
make
|
||||
sudo make install
|
||||
sudo make uninstall
|
||||
debian:
|
||||
runs-on: ubuntu-20.04
|
||||
container: debian:buster
|
||||
container: debian:bullseye
|
||||
steps:
|
||||
- name: install tools
|
||||
run: |
|
||||
@@ -33,7 +37,7 @@ jobs:
|
||||
run: |
|
||||
debian/nightly-changelog.sh
|
||||
env:
|
||||
DISTRO: buster
|
||||
DISTRO: bullseye
|
||||
- name: build package
|
||||
run: |
|
||||
debuild -us -uc
|
||||
|
||||
@@ -1,23 +1,32 @@
|
||||
CXX ?= g++
|
||||
CXXFLAGS ?= -std=c++17 -Wall -Werror -Wno-error=deprecated-declarations -O2
|
||||
PREFIX ?= /usr/local
|
||||
DESTDIR ?=
|
||||
|
||||
.PHONY: all
|
||||
all: infoconv infoedit
|
||||
|
||||
infoconv: infoconv.cpp
|
||||
$(CXX) -o infoconv -std=c++11 infoconv.cpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ $<
|
||||
|
||||
infoedit: infoedit.hpp infoedit.cpp
|
||||
$(CXX) -o infoedit -std=c++11 infoedit.cpp -lboost_program_options
|
||||
infoedit: infoedit.cpp infoedit.hpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ $< -lboost_program_options
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
clang-format-8 -i -style=file *.[hc]pp
|
||||
clang-format-11 -i -style=file *.[hc]pp
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f infoconv infoedit
|
||||
|
||||
.PHONY: install
|
||||
install: infoconv infoedit
|
||||
install -d $(DESTDIR)$(PREFIX)/bin
|
||||
install infoconv $(DESTDIR)$(PREFIX)/bin/infoconv
|
||||
install infoedit $(DESTDIR)$(PREFIX)/bin/infoedit
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
rm $(DESTDIR)$(PREFIX)/bin/infoconv
|
||||
rm $(DESTDIR)$(PREFIX)/bin/infoedit
|
||||
|
||||
Reference in New Issue
Block a user