X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=Makefile;h=e51f40a57db9285439ac38a0c64d12125682da69;hb=25d71dcb7110a90a83b287686ce27c7de450c619;hp=5113e701f6898df8fee225723cd599cbf1c9dda7;hpb=3d27274b36b44816c736ea8a411341b5a36556f9;p=blerg.git diff --git a/Makefile b/Makefile index 5113e70..e51f40a 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,25 @@ +include libs.mk + CFLAGS ?= -g -INCLUDES = -I. -Ifcgi -Idatabase -Icommon -Icgi-util-2.2.1 -Ilibmicrohttpd-0.9.3/src/include -Iyajl/build/yajl-1.0.11/include +INCLUDES = -I. -Idatabase -Icommon $(YAJL_INCLUDES) +HTTP_INCLUDES = -Ihttp $(MHD_INCLUDES) +CGI_INCLUDES = -Icgi $(CGI_UTIL_INCLUDES) LDFLAGS ?= -HTTP_LIBDIRS = -Llibmicrohttpd-0.9.3/src/daemon/.libs -Lyajl/build/yajl-1.0.11/lib -CGI_LIBDIRS = -Lcgi-util-2.2.1 -Lyajl/build/yajl-1.0.11/lib +HTTP_LIBDIRS = $(MHD_LIBDIR) $(YAJL_LIBDIR) +CGI_LIBDIRS = $(CGI_UTIL_LIBDIR) $(YAJL_LIBDIR) -targets = blerg.a blergtool http_blerg cgi_blerg -blerg_a_objects = database/database.o database/tags.o +targets = blerg.a blergtool blerglatest blerg.cgi rss.cgi www/build/enyo-blerg.js +blerg_a_objects = database/database.o database/tags.o database/util.o database/subscription.o common/stringbucket.o blergtool_objects = tools/blergtool.o blerg.a -http_blerg_objects = http/http_blerg.o http/canned_responses.o common/app.o common/auth.o blerg.a -cgi_blerg_objects = cgi/cgi_blerg.o common/app.o common/auth.o blerg.a +blerglatest_objects = tools/blerglatest.o blerg.a common/json.o +rss_objects = cgi/rss.o cgi/canned_responses.o common/app.o common/escapery.o blerg.a +http_blerg_objects = http/http_blerg.o http/canned_responses.o common/app.o common/json.o common/auth.o common/md5.o blerg.a +cgi_blerg_objects = cgi/cgi_blerg.o cgi/canned_responses.o common/app.o common/json.o common/auth.o common/md5.o blerg.a all: $(targets) clean: - rm -f $(targets) $(blerg_a_objects) $(blergtool_objects) $(http_blerg_objects) + rm -f $(targets) $(blerg_a_objects) $(blergtool_objects) $(blerglatest_objects) $(http_blerg_objects) $(cgi_blerg_objects) $(rss_objects) blerg.a: $(blerg_a_objects) ar rcu $@ $(blerg_a_objects) @@ -21,11 +27,27 @@ blerg.a: $(blerg_a_objects) blergtool: $(blergtool_objects) gcc $(LDFLAGS) $^ -o $@ -http_blerg: $(http_blerg_objects) +blerglatest: $(blerglatest_objects) + gcc $(YAJL_LIBDIR) $(LDFLAGS) $^ -lyajl_s -o $@ + +blerg.httpd: $(http_blerg_objects) gcc $(HTTP_LIBDIRS) $(LDFLAGS) $(http_blerg_objects) -lpthread -lmicrohttpd -lyajl_s -o $@ -cgi_blerg: $(cgi_blerg_objects) +blerg.cgi: $(cgi_blerg_objects) gcc $(CGI_LIBDIRS) $(LDFLAGS) $(cgi_blerg_objects) -lcgi-util -lyajl_s -o $@ +rss.cgi: $(rss_objects) + gcc $(CGI_LIBDIRS) $(LDFLAGS) $(rss_objects) -lcgi-util -o $@ + +http/%.o: http/%.c + gcc $(INCLUDES) $(HTTP_INCLUDES) $(CFLAGS) -c $< -o $@ + +cgi/%.o: cgi/%.c + gcc $(INCLUDES) $(CGI_INCLUDES) $(CFLAGS) -c $< -o $@ + %.o: %.c gcc $(INCLUDES) $(CFLAGS) -c $< -o $@ + +www/build/enyo-blerg.js: www/jssrc/blerg/* www/jssrc/package.js www/jssrc/package-min.js + which node >/dev/null # Please install Node.js to re-minify the JS + cd www/jssrc && enyo/tools/minify.sh -output ../build/enyo-blerg -no-alias package-min.js