forked from mirrors/qotd
@@ -1,3 +1,4 @@
|
|||||||
# Project exclude paths
|
# Project exclude paths
|
||||||
/cmake-build-debug/
|
/cmake-build-debug/
|
||||||
/.idea/
|
/.idea/
|
||||||
|
build
|
||||||
@@ -1,6 +1,12 @@
|
|||||||
cmake_minimum_required(VERSION 3.19)
|
cmake_minimum_required(VERSION 3.19)
|
||||||
project(qotd C)
|
project(qotd C)
|
||||||
|
|
||||||
|
message("STATIC_BUILD=${STATIC_BUILD}")
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 99)
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
add_executable(qotd main.c quote.c quote.h server.c server.h config.h)
|
add_executable(qotd main.c quote.c quote.h server.c server.h config.h)
|
||||||
|
|
||||||
|
if ( STATIC_BUILD )
|
||||||
|
target_link_libraries(qotd -static)
|
||||||
|
endif()
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
FROM git.legonzaur.fr/legonzaur/qotd/builder:latest AS builder
|
||||||
|
|
||||||
|
WORKDIR /opt/builder
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN cmake -B build -DSTATIC_BUILD=true
|
||||||
|
WORKDIR build
|
||||||
|
RUN make
|
||||||
|
|
||||||
|
FROM alpine
|
||||||
|
COPY --from=builder /opt/builder/build/qotd /
|
||||||
|
ENTRYPOINT ["/qotd"]
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
RUN apk add --no-cache cmake make gcc musl-dev
|
||||||
@@ -8,13 +8,11 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <bits/types/FILE.h>
|
|
||||||
#include <bits/types/struct_FILE.h>
|
|
||||||
|
|
||||||
void getRandomQuote(char quote[2048]);
|
void getRandomQuote(char quote[2048]);
|
||||||
|
|
||||||
void getQuote(long line, char quote[2048]);
|
void getQuote(long line, char quote[2048]);
|
||||||
|
|
||||||
int getFileLineCount(char* filename);
|
int getFileLineCount(char *filename);
|
||||||
|
|
||||||
#endif //QOTD_QUOTE_H
|
#endif // QOTD_QUOTE_H
|
||||||
|
|||||||
Reference in New Issue
Block a user