Source

vimclojure / Makefile

Diff from to
-PROJECT := gorilla
+# This Makefile has only been tested on linux.  It uses
+# MinGW32 to cross-compile for windows.  To install and
+# configure MinGW32 on linux, see
+# http://www.mingw.org/MinGWiki/index.php/BuildMingwCross
+#
+# Marty Lamb
 
-SRCDIR  := src
-DISTDIR := classes
+CC=gcc
+WIN32_CC=/usr/local/mingw32/bin/mingw32-gcc
+CFLAGS=-Wall -pedantic -s -O3
 
-CLJSRC  != find ${SRCDIR} -type f -name \*.clj
-DIRS    != cd ${SRCDIR} && find * -type d
+ng: ngclient/ng.c
+	@echo "Building ng client.  To build a Windows binary, type 'make ng.exe'"
+	${CC} ${CFLAGS} -o ng ngclient/ng.c
 
-VERSION != shtool version -d short version.txt
-JAR     := ${PROJECT}.jar
-TGZ     := ${PROJECT}-${VERSION}.tar.gz
-
-all: jar
-
-release: jar tarball
-
-jar: ${JAR}
-
-tarball: ${TGZ}
-
-test: jar
-	env CLASSPATH=${JAR}:$${CLASSPATH} prove t
-
+ng.exe: ngclient/ng.c
+	# any idea why the command line is so sensitive to the order of
+	# the arguments?  If CFLAGS is at the beginning, it won't link.
+	${WIN32_CC} -o ng.exe ngclient/ng.c -lwsock32 -O3 ${CFLAGS}
+	
 clean:
-	rm -rf ${DISTDIR} ${JAR} ${TGZ}
-
-compile: ${CLJSRC} ${DISTDIR}
-	env CLASSPATH=${SRCDIR}:${DISTDIR}:$${CLASSPATH}\
-		java clojure.lang.Script compile.clj
-
-bump-version:
-	shtool version -l txt -n ${PROJECT} -i v version.txt
-
-bump-revision:
-	shtool version -l txt -n ${PROJECT} -i r version.txt
-
-bump-level:
-	shtool version -l txt -n ${PROJECT} -i l version.txt
-
-${JAR}: compile
-	cp README.txt ${DISTDIR}
-	cp LICENSE ${DISTDIR}
-	jar cf ${JAR} -C ${DISTDIR} .
-
-${TGZ}:
-	shtool tarball -c "gzip -9" -o ${TGZ} \
-		-e '\.DS_Store,${DISTDIR},\.hg,\.tar\.gz' .
-
-${DISTDIR}:
-	shtool mkdir -p ${DISTDIR}
-	@for dir in ${DIRS}; do \
-		echo shtool mkdir -p ${DISTDIR}/$${dir}; \
-		shtool mkdir -p ${DISTDIR}/$${dir}; \
-	done
-
-.PHONY: all release jar tarball test clean compile
+	@echo "If you have a Windows binary, 'make clean' won't delete it."
+	@echo "You must remove this manually.  Most users won't have MinGW"
+	@echo "installed - so I'd rather not delete something they can't rebuild."
+	rm ng
+#	rm ng.exe