Skip to content

Commit

Permalink
Makefile updated with tests for both install and uninstall. The
Browse files Browse the repository at this point in the history
general test target will now also run these tests.
  • Loading branch information
mjohnsullivan committed Jun 1, 2012
1 parent a86c1ba commit e5cb5df
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Makefile
Expand Up @@ -239,9 +239,27 @@ bundle/luvit: build/luvit ${BUILDDIR}/libluvit.a
$(CC) --std=c89 -D_GNU_SOURCE -g -Wall -Werror -DBUNDLE -c src/luvit_main.c -o bundle/luvit_main.o -I${HTTPDIR} -I${UVDIR}/include -I${LUADIR}/src -I${YAJLDIR}/src/api -I${YAJLDIR}/src -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHTTP_VERSION=\"${HTTP_VERSION}\" -DUV_VERSION=\"${UV_VERSION}\" -DYAJL_VERSIONISH=\"${YAJL_VERSION}\" -DLUVIT_VERSION=\"${VERSION}\" -DLUAJIT_VERSION=\"${LUAJIT_VERSION}\"
$(CC) ${LDFLAGS} -g -o bundle/luvit ${BUILDDIR}/libluvit.a `ls bundle/*.o` ${LIBS} ${CRYPTODIR}/src/lcrypto.o

test: ${BUILDDIR}/luvit
# Test section

test: test-lua test-install test-uninstall

test-lua: ${BUILDDIR}/luvit
cd tests && ../${BUILDDIR}/luvit runner.lua

ifeq ($(MAKECMDGOALS),test)
DESTDIR=test_install
endif

test-install: install
test -f ${BINDIR}/luvit
test -d ${INCDIR}
test -d ${LIBDIR}

test-uninstall: uninstall
test ! -f ${BINDIR}/luvit
test ! -d ${INCDIR}
test ! -d ${LIBDIR}

api: api.markdown

api.markdown: $(wildcard lib/*.lua)
Expand All @@ -267,5 +285,5 @@ tarball:
tar -czf ${DIST_FILE} -C ${DIST_DIR}/${VERSION} ${DIST_NAME}
rm -rf ${DIST_FOLDER}

.PHONY: test install all api.markdown bundle tarball
.PHONY: test install uninstall all api.markdown bundle tarball

0 comments on commit e5cb5df

Please sign in to comment.