Skip to content

Commit

Permalink
//
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipDeegan committed Jun 16, 2024
1 parent de93006 commit 2410c9a
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 175 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_many_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- run: make nix
- run: ./res/ci/nixish_setup.sh && make nix -j2

- env:
MKN_GCC_PREFERRED: 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- run: make nix
- run: ./res/ci/nixish_setup.sh && make nix -j2

- env:
MKN_GCC_PREFERRED: 1
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build_osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- run: make bsd
- run: ./res/ci/nixish_setup.sh && make bsd -j2

- env:
MKN_LIB_LINK_LIB: 1
KUL_GIT_CO: --depth 1
run: |
brew install ccache
mkdir ~/.maiken && cp res/mkn/clang.yml ~/.maiken/settings.yaml
KLOG=3 ./mkn build -dtKO 2 -W 9 -g 0
KLOG=3 ./mkn build -dtOp test_mod
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-12, macos-latest]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -31,7 +31,7 @@ jobs:
MKN_GCC_PREFERRED: 1
KUL_GIT_CO: --depth 1
run: |
make nix
./res/ci/nixish_setup.sh && make nix -j2
KLOG=3 ./mkn build -dtKa "-std=c++17 -fPIC" -O 2 -g 0 -W 9 -o mkn_nix
- if: matrix.os == 'ubuntu-latest'
Expand All @@ -54,7 +54,7 @@ jobs:
container: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v3
- run: make nix
- run: ./res/ci/nixish_setup.sh && make nix -j2
- env:
MKN_GCC_PREFERRED: 1
KUL_GIT_CO: --depth 1
Expand All @@ -70,7 +70,7 @@ jobs:
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- run: make bsd
- run: ./res/ci/nixish_setup.sh && make bsd -j2
- env:
MKN_GCC_PREFERRED: 1
KUL_GIT_CO: --depth 1
Expand All @@ -86,7 +86,7 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- run: make bsd
- run: ./res/ci/nixish_setup.sh && make bsd -j2
- env:
MKN_GCC_PREFERRED: 1
KUL_GIT_CO: --depth 1
Expand Down
79 changes: 24 additions & 55 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@

KUL_GIT=master
YAML_GIT=master

CWD:=$(CURDIR)
ifeq ($(strip $(CURDIR)),)
CWD:=$(.CURDIR)
endif

OS =
CXX=g++
CXXFLAGS=-std=c++17 -Os -Wall -fmessage-length=0 -fPIC -g3
CXXFLAGS=-std=c++17 -O2 -Wall -fmessage-length=0 -fPIC
INCS = -Iinc \
-Iext/parse/yaml/$(YAML_GIT)/p/include \
-Iext/mkn/kul/$(KUL_GIT)/inc \
-Iext/mkn/kul/$(KUL_GIT)/os/$(OS)/inc \
-Iext/mkn/kul/$(KUL_GIT)/os/nixish/inc

YAML = ext/parse/yaml/$(YAML_GIT)/p/bin/libyaml.a
-Iext/parse/yaml/p/include \
-Iext/mkn/kul/inc \
-Iext/mkn/kul/os/$(OS)/inc \
-Iext/mkn/kul/os/nixish/inc
YAML = bin/yaml/libyaml.a
LDFLAGS = -pthread -ldl -rdynamic

EXE=mkn
WHICH=which
YAML_SOURCES :=$(shell find ext/parse/yaml/p/src -type f -name '*.cpp')
YAML_LIB :=$(YAML_SOURCES:.cpp=)

MKN_SOURCES :=$(shell find src -type f -name '*.cpp')
MKN_BIN :=$(MKN_SOURCES:.cpp=)

entry:
@@echo "Options include"
Expand All @@ -41,53 +40,23 @@ bsd:
$(eval CXXFLAGS := $(CXXFLAGS))
$(MAKE) general OS=$(OS)

prechecks:
@if [ -z "$$($(WHICH) git)" ]; then echo "git NOT FOUND - EXITING"; exit 1; fi

general:
$(MAKE) prechecks

@if [ ! -d "./ext/mkn/kul/$(KUL_GIT)" ]; then \
git clone --depth 1 https://github.com/mkn/mkn.kul.git --branch $(KUL_GIT) ext/mkn/kul/$(KUL_GIT); \
fi;

@if [ ! -d "ext/parse/yaml/$(YAML_GIT)" ]; then \
git clone --depth 1 https://github.com/mkn/parse.yaml.git --branch $(YAML_GIT) ext/parse/yaml/$(YAML_GIT); \
cd ext/parse/yaml/$(YAML_GIT); \
./mkn.sh; \
cd ../../..; \
fi;
@if [ ! -d "ext/parse/yaml/$(YAML_GIT)/p/bin" ]; then \
mkdir ext/parse/yaml/$(YAML_GIT)/p/bin; \
fi;
@if [ ! -f "$(YAML)" ]; then \
$(MAKE) caml; \
$(MAKE) yaml; \
fi;

@mkdir -p bin;

@for f in $(shell find src -type f -name '*.cpp'); do \
echo $(CXX) $(CXXFLAGS) $(INCS) -o "bin/$$(basename $$f).o" -c "$$f"; \
$(CXX) $(CXXFLAGS) $(INCS) -o "bin/$$(basename $$f).o" -c "$$f" || exit 1 ; \
done;
@$(CXX) $(CXXFLAGS) $(INCS) -o "bin/mkn.cpp.o" -c "mkn.cpp"
@mkdir -p bin/yaml bin/mkn;
$(MAKE) compile
$(MAKE) link
@@rm -rf ext bin
@@rm -rf bin ext

link:
$(eval FILES := $(foreach dir,$(shell find bin -type f -name *.o),$(dir)))
$(CXX) -o "$(EXE)" $(FILES) $(YAML) $(LDFLAGS)
compile:$(YAML_LIB) $(MKN_BIN)
$(CXX) $(CXXFLAGS) $(INCS) -o "bin/mkn/main.o" -c "mkn.cpp"

caml:
@for f in $(shell find ext/parse/yaml/$(YAML_GIT)/p/src -type f -name '*.cpp'); do \
echo $(CXX) $(CXXFLAGS) -Iext/parse/yaml/$(YAML_GIT)/p/include -o "ext/parse/yaml/$(YAML_GIT)/p/bin/$$(basename $$f).o" -c "$$f"; \
$(CXX) $(CXXFLAGS) -Iext/parse/yaml/$(YAML_GIT)/p/include -o "ext/parse/yaml/$(YAML_GIT)/p/bin/$$(basename $$f).o" -c "$$f" || exit 1 ; \
done;
link:
ar -r $(YAML) bin/yaml/*.o
$(CXX) -o "mkn" bin/mkn/*.o $(YAML) $(LDFLAGS)

yaml:
$(eval FILES := $(foreach dir,$(shell find ext/parse/yaml/$(YAML_GIT)/p/bin -type f -name *.o),$(dir)))
ar -r $(YAML) $(FILES)
$(YAML_LIB):$(YAML_SOURCES)
$(CXX) $(CXXFLAGS) -Iext/parse/yaml/p/include -o "bin/yaml/$(shell basename $(shell dirname $@))_$(shell basename $@).o" -c $@.cpp
$(MKN_BIN):$(MKN_SOURCES)
$(CXX) $(CXXFLAGS) $(INCS) -o "bin/mkn/$(shell basename $(shell dirname $@))_$(shell basename $@).o" -c $@.cpp

clean:
rm -rf bin ext
rm -rf bin
33 changes: 0 additions & 33 deletions res/ci/mac_bintray.json

This file was deleted.

33 changes: 0 additions & 33 deletions res/ci/nix_bintray.json

This file was deleted.

12 changes: 0 additions & 12 deletions res/ci/nix_travis.sh

This file was deleted.

14 changes: 14 additions & 0 deletions res/ci/nixish_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -exu
CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" && cd "$CWD"/../..
MKN_KUL_GIT=${MKN_KUL_GIT:-master}
YAML_CPP_GIT=${YAML_CPP_GIT:-master}

rm -rf bin && mkdir bin
[ -d "./ext/mkn/kul" ] || \
git clone --depth 1 https://github.com/mkn/mkn.kul.git -b "${MKN_KUL_GIT}" "ext/mkn/kul";

[ -d "ext/parse/yaml" ] || (
git clone --depth 1 https://github.com/mkn/parse.yaml.git --branch "${YAML_CPP_GIT}" "ext/parse/yaml";
cd "ext/parse/yaml" && ./mkn.sh && mkdir -p p/bin
)
12 changes: 0 additions & 12 deletions res/ci/osx_travis.sh

This file was deleted.

21 changes: 0 additions & 21 deletions res/ci/win_appveyor.sh

This file was deleted.

2 changes: 1 addition & 1 deletion res/mkn/clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ remote:
file:
- type: cpp:cxx:cc
archiver: ar -cr
compiler: ccache clang++ -std=c++17 -fPIC
compiler: clang++ -std=c++17 -fPIC
linker: g++

0 comments on commit 2410c9a

Please sign in to comment.