diff options
| author | Fuwn <[email protected]> | 2024-06-11 08:07:03 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-06-11 08:07:03 +0000 |
| commit | 0b5e41a060f818c8d455872062522fb96a20c261 (patch) | |
| tree | fef298ca9945ea46bebff40b27a0f2d9a027fbee | |
| parent | refactor: tighen clang-tidy (diff) | |
| download | maple-0b5e41a060f818c8d455872062522fb96a20c261.tar.xz maple-0b5e41a060f818c8d455872062522fb96a20c261.zip | |
build(docker): add simple build.ninja for Dockerfile
| -rw-r--r-- | .dockerignore | 15 | ||||
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | Dockerfile | 15 | ||||
| -rw-r--r-- | build.ninja | 20 |
4 files changed, 35 insertions, 18 deletions
diff --git a/.dockerignore b/.dockerignore index a5707a7..dbc39fc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,13 +1,6 @@ -# Development -*.pem -out/ +# Ignore everything +** -# CMake -cmake-build-*/ -CMakeLists.txt +!maple +!build.ninja -# Ninja -.ninja_* - -# IDE -.idea/ @@ -11,3 +11,6 @@ # Build Artifacts build +# Ninja +.ninja_log + @@ -1,16 +1,17 @@ FROM alpine:latest as environment RUN apk update \ - && apk upgrade \ - && apk add --no-cache libstdc++ + && apk upgrade \ + && apk add --no-cache libstdc++ FROM environment as build_environment RUN apk add --no-cache \ - clang \ - ninja \ - alpine-sdk \ - openssl-dev + clang \ + ninja \ + alpine-sdk \ + openssl-dev \ + linux-headers FROM build_environment as builder @@ -24,7 +25,7 @@ FROM environment WORKDIR /maple -COPY --from=builder /maple/out/maple ./ +COPY --from=builder /maple/build/maple ./ EXPOSE 1965 diff --git a/build.ninja b/build.ninja new file mode 100644 index 0000000..8505e2c --- /dev/null +++ b/build.ninja @@ -0,0 +1,20 @@ +cc = clang++ +cxxflags = -std=c++23 -Weverything -Wno-padded -Wno-c++98-compat -MMD -Wno-c++98-compat-pedantic +ldflags = -lssl -lcrypto +outdir = build +name = maple +srcdir = $name + +rule compile + command = $cc $cxxflags -c $in -o $out + +rule link + command = $cc $in -o $out $ldflags + +build $outdir/$name.o: compile $srcdir/$name.cc +build $outdir/gemini.o: compile $srcdir/gemini.cc +build $outdir/titan.o: compile $srcdir/titan.cc + +build $outdir/$name: link $outdir/$name.o $outdir/gemini.o $outdir/titan.o + +default $outdir/$name |