diff options
Diffstat (limited to 'src/blogc-make')
-rw-r--r-- | src/blogc-make/CMakeLists.txt | 50 | ||||
-rw-r--r-- | src/blogc-make/main.c | 6 |
2 files changed, 55 insertions, 1 deletions
diff --git a/src/blogc-make/CMakeLists.txt b/src/blogc-make/CMakeLists.txt new file mode 100644 index 0000000..778db37 --- /dev/null +++ b/src/blogc-make/CMakeLists.txt @@ -0,0 +1,50 @@ +# SPDX-FileCopyrightText: 2024 Rafael G. Martins <rafael@rafaelmartins.eng.br> +# SPDX-License-Identifier: BSD-3-Clause + +if(NOT DEFINED HAVE_DIRENT_H OR + NOT DEFINED HAVE_FCNTL_H OR + NOT DEFINED HAVE_LIBGEN_H OR + NOT DEFINED HAVE_SYS_STAT_H OR + NOT DEFINED HAVE_SYS_WAIT_H OR + NOT DEFINED HAVE_TIME_H OR + NOT DEFINED HAVE_UNISTD_H) + message(FATAL_ERROR "Missing header dependencies for blogc-make") +endif() + +add_library(libblogc_make STATIC + atom.c + atom.h + ctx.c + ctx.h + exec.c + exec.h + exec-native.c + exec-native.h + httpd.c + httpd.h + reloader.c + reloader.h + rules.c + rules.h + settings.c + settings.h + utils.c + utils.h +) + +target_link_libraries(libblogc_make PRIVATE + libblogc_common + m +) + +if(NOT BUILD_BLOGC_MAKE_EMBEDDED) + add_executable(blogc-make + main.c + ) + + target_link_libraries(blogc-make PRIVATE + libblogc_make + ) + + install(TARGETS blogc-make) +endif() diff --git a/src/blogc-make/main.c b/src/blogc-make/main.c index 5d3f686..7007c1a 100644 --- a/src/blogc-make/main.c +++ b/src/blogc-make/main.c @@ -14,6 +14,10 @@ #include "ctx.h" #include "rules.h" +#ifndef PACKAGE_VERSION +#define PACKAGE_VERSION "Unknown" +#endif + static void print_help(void) @@ -70,7 +74,7 @@ main(int argc, char **argv) print_help(); goto cleanup; case 'v': - printf("%s\n", PACKAGE_STRING); + printf("blogc " PACKAGE_VERSION "\n"); goto cleanup; case 'D': dev = true; |