]> mj.ucw.cz Git - moe.git/blobdiff - judge/Makefile
Compile the judge support functions as a separate library.
[moe.git] / judge / Makefile
index c9ddb07b3e9451d57c91b339a8fe2521a153b476..561df24a7894e68192fde50b2292bdfee0d46bae 100644 (file)
@@ -1,20 +1,18 @@
-CC=gcc-4.1.1
-CFLAGS=-O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wredundant-decls -Winline $(DEBUG) -std=gnu99
-CFLAGS+=-Wno-pointer-sign -Wdisabled-optimization -Wno-missing-field-initializers
+# Makefile for MO-Eval judges
+# (c) 2008--2009 Martin Mares <mj@ucw.cz>
 
-all: test-io test-tok judge-tok judge-shuff filter-cmt
+DIRS+=judge
+JDIR=$(o)/judge
+PROGS+=$(addprefix $(JDIR)/,test-io test-tok judge-tok judge-shuff filter-cmt)
+JLIB=$(JDIR)/libjudge.a
 
-JLIB=utils.o io.o token.o
+$(JDIR)/test-io: $(JDIR)/test-io.o $(JLIB)
+$(JDIR)/test-tok: $(JDIR)/test-tok.o $(JLIB)
+$(JDIR)/judge-tok: $(JDIR)/judge-tok.o $(JLIB)
+$(JDIR)/judge-tok: LDLIBS+=-lm
+$(JDIR)/judge-shuff: $(JDIR)/judge-shuff.o $(JLIB)
+$(JDIR)/filter-cmt: $(JDIR)/filter-cmt.o $(JLIB)
 
-test-io: test-io.o $(JLIB)
-test-tok: test-tok.o $(JLIB)
-judge-tok: judge-tok.o $(JLIB)
-judge-tok: LDLIBS+=-lm
-judge-shuff: judge-shuff.o $(JLIB)
-filter-cmt: filter-cmt.o $(JLIB)
+$(JLIB): $(addprefix $(JDIR)/,utils.o io.o token.o)
 
-clean::
-       rm -f `find . -name "*~" -or -name "*.[oa]" -or -name "\#*\#" -or -name TAGS -or -name core`
-       rm -f test-io test-tok judge-tok filter-cmt
-
-.PHONY: all clean distclean
+TESTS+=$(addprefix $(JDIR)/,io.test token.test judge-tok.test filter-cmt.test)