Skip to content

Commit

Permalink
Add CI workflow for makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcima committed Mar 25, 2021
1 parent ce7800a commit e533bd1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,36 @@ jobs:
name: Win64 MinGW tarball
path: ${{runner.workspace}}/build/${{env.install_name}}.tar.gz

build_with_makefile:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build with GNU make
shell: bash
run: make -C "$GITHUB_WORKSPACE" -f generic.mk -j2
- name: Compile a simple program
shell: bash
run: |
cat <<EOF > "$GITHUB_WORKSPACE"/simple.cpp
#include <sfizz.hpp>
int main() {
sfz::Sfizz synth;
synth.loadSfzString("", "");
return 0;
}
EOF
cat <<EOF > "$GITHUB_WORKSPACE"/simple.mk
all: simple
include generic.mk
simple.o: simple.cpp
\$(CXX) \$(CXXFLAGS) \$(SFIZZ_CXX_FLAGS) -c -o \$@ \$<
simple: simple.o \$(SFIZZ_TARGET)
\$(CXX) -o \$@ \$^ \$(SFIZZ_LINK_FLAGS) \$(LDFLAGS)
EOF
make -C "$GITHUB_WORKSPACE" -f simple.mk
archive_source_code:
runs-on: ubuntu-18.04
if: startsWith(github.ref, 'refs/tags/')
Expand Down
6 changes: 5 additions & 1 deletion generic.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ endif

###

SFIZZ_TARGET := $(SFIZZ_BUILD_DIR)/libsfizz.a

###

all: lib

lib: $(SFIZZ_BUILD_DIR)/libsfizz.a
lib: $(SFIZZ_TARGET)

clean:
rm -rf $(SFIZZ_BUILD_DIR)
Expand Down

0 comments on commit e533bd1

Please sign in to comment.