implement out of source builds

This commit is contained in:
Lloyd Hilaiel 2013-06-11 09:33:46 -06:00
Родитель ecb9f716e4
Коммит c6056dfae3
1 изменённых файлов: 10 добавлений и 13 удалений

Просмотреть файл

@ -1,26 +1,23 @@
CC=gcc
ifeq ($(APXS_PATH),)
APXS_PATH=/usr/sbin/apxs
endif
MY_LDFLAGS=-lcurl -lyajl
# Note that gcc flags are passed through apxs, so preface with -Wc
MY_CFLAGS=-Wc,-I. -Wc,-Wall
SRCS=mod_auth_browserid.c
.SUFFIXES: .c .o .la
.c.la:
$(APXS_PATH) $(MY_LDFLAGS) $(MY_CFLAGS) -c $<
.c.o:
$(CC) -c $<
all: mod_auth_browserid.la
build/.libs/mod_auth_browserid.so: $(SRCS)
@mkdir -p build/
@cd build && for file in $^ ; do ln -sf ../$$file . ; done
@cd build && $(APXS_PATH) $(MY_LDFLAGS) $(MY_CFLAGS) -c $^
install: mod_auth_browserid.la
@echo "-"$*"-" "-"$?"-" "-"$%"-" "-"$@"-" "-"$<"-"
$(APXS_PATH) -i $?
all: build/.libs/mod_auth_browserid.so
install: build/.libs/mod_auth_browserid.so
$(APXS_PATH) -i build/mod_auth_browserid.c
clean:
-rm -f *.o *.lo *.la *.slo
-rm -rf .libs
-rm -rf build