X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=Makefile;h=eb99c154ef2ee82e6d5e7112fde588cc92020934;hb=09ed7fdfdaa09307dfc9256a4e7488fa6cec0a7c;hp=850da29bfb1b6fc6cf78bb2cd8e9edf00843b073;hpb=681f470b41ea3674089425b5227a5b0b76291118;p=blerg.git diff --git a/Makefile b/Makefile index 850da29..eb99c15 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,10 @@ include libs.mk +ARCH=$(shell uname -m) CFLAGS ?= -g +ifeq ($(ARCH),x86_64) + CFLAGS += -fPIC +endif INCLUDES = -I. -Idatabase -Icommon -Ibuilddeps/scrypt-1.1.6/lib/crypto $(YAJL_INCLUDES) HTTP_INCLUDES = -Ihttp $(MHD_INCLUDES) CGI_INCLUDES = -Icgi $(CGI_UTIL_INCLUDES) @@ -8,23 +12,27 @@ LDFLAGS ?= HTTP_LIBDIRS = $(MHD_LIBDIR) $(YAJL_LIBDIR) CGI_LIBDIRS = $(CGI_UTIL_LIBDIR) $(YAJL_LIBDIR) -targets = blerg.a blergtool blerglatest blerg.cgi www/build/enyo-blerg.js +targets = blerg.a blerg_auth.a blergtool blerglatest blerg.cgi www/build/enyo-blerg.js blerg_a_objects = database/database.o database/tags.o database/util.o database/subscription.o common/stringbucket.o +blerg_auth_a_objects = common/auth.o common/md5.o blergtool_objects = tools/blergtool.o blerg.a blerglatest_objects = tools/blerglatest.o blerg.a common/json.o -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 builddeps/scrypt.a blerg.a +http_blerg_objects = http/http_blerg.o http/canned_responses.o common/app.o common/json.o blerg_auth.a builddeps/scrypt.a blerg.a +cgi_blerg_objects = cgi/cgi_blerg.o cgi/canned_responses.o common/app.o common/json.o blerg_auth.a builddeps/scrypt.a blerg.a all: $(targets) clean: - rm -f $(targets) $(blerg_a_objects) $(blergtool_objects) $(blerglatest_objects) $(http_blerg_objects) $(cgi_blerg_objects) builddeps/*.a + rm -f $(targets) $(blerg_a_objects) $(blerg_auth_a_objects) $(blergtool_objects) $(blerglatest_objects) $(http_blerg_objects) $(cgi_blerg_objects) builddeps/*.a @make -C builddeps/scrypt-1.1.6 distclean @make -C builddeps/scrypt-1.1.6/lib/crypto clean blerg.a: $(blerg_a_objects) ar rcu $@ $(blerg_a_objects) +blerg_auth.a: builddeps/scrypt.a $(blerg_auth_a_objects) + ar rcu $@ $(blerg_auth_a_objects) + blergtool: $(blergtool_objects) gcc $(LDFLAGS) $^ -o $@