aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.am
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2016-12-27 02:29:54 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2016-12-27 02:43:59 +0100
commit8cac2c3e3a61b64b9a9855dec413239bcec7f9d2 (patch)
tree6240cdabaa0352f08d62bbfa6de7c53f5a3f1063 /Makefile.am
parent7bf68b0b617fb3ffa86f38fe06a49786883037f4 (diff)
downloadblogc-8cac2c3e3a61b64b9a9855dec413239bcec7f9d2.tar.gz
blogc-8cac2c3e3a61b64b9a9855dec413239bcec7f9d2.tar.bz2
blogc-8cac2c3e3a61b64b9a9855dec413239bcec7f9d2.zip
make: implemented a build tool for blogc
so, this is basically what happens when you don't have anything better to do in the christmas weekend. most of this code was written in the last 2 or 3 days. i'd like to thank the chivas brothers, the weather and my psychological problems for this achievement. on a serious note, this tool still needs a man page, more tests, and the aws lambda function should be adapted to use it instead of (or together with) make/busybox. also, while talking about aws lambda, this tool can be nicely embedded into the blogc binary, to produce a single "small" static binary for usage in lambda ;)
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am91
1 files changed, 91 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 622d43d..bd69302 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,6 +5,7 @@ ACLOCAL_AMFLAGS = -I m4
AM_DISTCHECK_CONFIGURE_FLAGS = \
CFLAGS="-Wall -g -O0" \
--enable-git-receiver \
+ --enable-make \
--enable-ronn \
--enable-runserver \
--enable-tests \
@@ -51,6 +52,12 @@ noinst_HEADERS = \
src/blogc-git-receiver/pre-receive-parser.h \
src/blogc-git-receiver/shell.h \
src/blogc-git-receiver/shell-command-parser.h \
+ src/blogc-make/atom.h \
+ src/blogc-make/ctx.h \
+ src/blogc-make/exec.h \
+ src/blogc-make/exec-native.h \
+ src/blogc-make/rules.h \
+ src/blogc-make/settings.h \
src/blogc-runserver/httpd.h \
src/blogc-runserver/httpd-utils.h \
src/blogc-runserver/mime.h \
@@ -84,6 +91,16 @@ noinst_LTLIBRARIES += \
$(NULL)
endif
+if BUILD_MAKE
+bin_PROGRAMS += \
+ blogc-make \
+ $(NULL)
+
+noinst_LTLIBRARIES += \
+ libblogc_make.la \
+ $(NULL)
+endif
+
if BUILD_RUNSERVER
bin_PROGRAMS += \
blogc-runserver \
@@ -148,6 +165,16 @@ blogc_LDADD = \
libblogc_common.la \
$(NULL)
+if BUILD_MAKE_EMBEDDED
+blogc_SOURCES += \
+ src/blogc-make/main.c \
+ $(NULL)
+
+blogc_LDADD += \
+ libblogc_make.la \
+ $(NULL)
+endif
+
if BUILD_GIT_RECEIVER
blogc_git_receiver_SOURCES = \
@@ -181,6 +208,46 @@ libblogc_git_receiver_la_LIBADD = \
endif
+if BUILD_MAKE
+blogc_make_SOURCES = \
+ src/blogc-make/main.c \
+ $(NULL)
+
+blogc_make_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(PTHREAD_CFLAGS) \
+ $(NULL)
+
+blogc_make_LDADD = \
+ $(PTHREAD_LIBS) \
+ libblogc_make.la \
+ libblogc_common.la \
+ $(NULL)
+endif
+
+if BUILD_MAKE_LIB
+libblogc_make_la_SOURCES = \
+ src/blogc-make/atom.c \
+ src/blogc-make/ctx.c \
+ src/blogc-make/exec.c \
+ src/blogc-make/exec-native.c \
+ src/blogc-make/rules.c \
+ src/blogc-make/settings.c \
+ $(NULL)
+
+libblogc_make_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(PTHREAD_CFLAGS) \
+ $(NULL)
+
+libblogc_make_la_LIBADD = \
+ $(LIBM) \
+ $(PTHREAD_LIBS) \
+ libblogc_common.la \
+ $(NULL)
+endif
+
+
if BUILD_RUNSERVER
blogc_runserver_SOURCES = \
src/blogc-runserver/main.c \
@@ -662,6 +729,30 @@ tests_blogc_git_receiver_check_shell_command_parser_LDADD = \
$(NULL)
endif
+if BUILD_MAKE_LIB
+check_PROGRAMS += \
+ tests/blogc-make/check_settings \
+ $(NULL)
+
+tests_blogc_make_check_settings_SOURCES = \
+ tests/blogc-make/check_settings.c \
+ $(NULL)
+
+tests_blogc_make_check_settings_CFLAGS = \
+ $(CMOCKA_CFLAGS) \
+ $(NULL)
+
+tests_blogc_make_check_settings_LDFLAGS = \
+ -no-install \
+ $(NULL)
+
+tests_blogc_make_check_settings_LDADD = \
+ $(CMOCKA_LIBS) \
+ libblogc_make.la \
+ libblogc_common.la \
+ $(NULL)
+endif
+
endif
endif