]> mj.ucw.cz Git - moe.git/commitdiff
Cleaned up installation of Perl modules. Also invoke submit makefile from
authorMartin Mares <mj@ucw.cz>
Thu, 28 Jun 2007 18:28:58 +0000 (20:28 +0200)
committerMartin Mares <mj@ucw.cz>
Thu, 28 Jun 2007 18:28:58 +0000 (20:28 +0200)
the top-level makefile.

Makefile
bin/mo-create-public
submit/Makefile

index abfeafd027a72a9f9697d7825d7075aadc172e18..7bc8e4a229727e3956673ce202df8cf8f04e499a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,20 @@
+# Makefile for mo-eval and related utilities
+# (c) 2007 Martin Mares <mj@ucw.cz>
+
 VERSION=1.0.1
 #DEBUG=-ggdb
-CFLAGS=-O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -Winline $(DEBUG)
+CFLAGS=-O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wredundant-decls -Winline $(DEBUG) -std=gnu99
+
+# Comment out if you are using a recent gcc
+CFLAGS+=-Wno-pointer-sign -Wdisabled-optimization -Wno-missing-field-initializers
+
+# Comment out if you do not wish to build remote submit utilities
+SUBMIT=submit
+LIBUCW:=$(shell cd ../libucw && pwd)
 
-all: bin/box bin/iwrapper bin/md5crypt bin/pedant
+export LIBUCW CFLAGS LDFLAGS DEBUG
+
+all: bin/box bin/iwrapper bin/md5crypt bin/pedant $(SUBMIT)
 
 bin/%: src/%.o
        $(CC) $(LDFLAGS) -o $@ $^
@@ -12,10 +24,22 @@ bin/iwrapper: src/iwrapper.o
 bin/md5crypt: src/md5crypt.o src/md5.o
 bin/pedant: src/pedant.o
 
-clean:
+submit:
+
+clean::
        rm -f `find . -name "*~" -or -name "*.[oa]" -or -name "\#*\#" -or -name TAGS -or -name core`
        rm -f bin/box bin/iwrapper bin/md5crypt bin/pedant
 
 distclean: clean
 
-.PHONY: all clean distclean
+ifdef SUBMIT
+
+submit:
+       $(MAKE) -C submit
+
+clean::
+       $(MAKE) -C submit clean
+
+endif
+
+.PHONY: all clean distclean submit
index bac7237d3a25909f732a02ab07ccf2fc3f9666e9..91c9c8e715deca1d252005ccd5b610daa40de851 100755 (executable)
@@ -19,9 +19,8 @@ done
 
 if [ -n "$REMOTE_SUBMIT" ] ; then
        cp $H/submit/{contest,remote-submit,remote-status} bin/
-       mkdir -p lib/perl5/{MO,Sherlock}
-       cp $H/submit/MO/*.pm lib/perl5/MO/
-       cp $H/submit/lib/perl5/Sherlock/Object.pm lib/perl5/Sherlock/
+       mkdir lib
+       cp -a $H/submit/lib .
 fi
 
 mkdir -p problems
index 8431079cf636e9cf318ae54fddc69e617273bd34..b1b3b116895fe836ef165ec072fb39a9f6427564 100644 (file)
@@ -1,16 +1,12 @@
 TLSCF:=$(shell libgnutls-config --cflags)
 TLSLF:=$(shell libgnutls-config --libs)
 GCRCF:=$(shell libgcrypt-config --cflags)
-LIBUCW=../../libucw
 
-CFLAGS=-O2 -I$(LIBUCW)/include -g -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wredundant-decls -std=gnu99 $(TLSCF) $(GCRCF)
-LDFLAGS=$(TLSLF)
-
-#CC=gcc-4.1.1
-CFLAGS+=-Wno-pointer-sign -Wdisabled-optimization -Wno-missing-field-initializers
+CFLAGS+=-I$(LIBUCW)/include $(TLSCF) $(GCRCF)
+LDFLAGS+=$(TLSLF)
 LDFLAGS+=-lpthread     # FIXME: Use libucw without threads
 
-all: submitd privkey
+all: submitd privkey lib
 
 submitd: submitd.o commands.o tasks.o $(LIBUCW)/lib/libsh.a $(LIBUCW)/lib/libucw.a
 submitd.o: submitd.c submitd.h
@@ -32,6 +28,21 @@ certs:
        certtool --generate-certificate --load-request client-req.pem --outfile client-cert.pem --load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem --template client-cert.tpl
        # Beware of serial numbers
 
+lib: .lib-stamp lib/perl5/MO/Submit.pm lib/perl5/Sherlock/Object.pm
+
+.lib-stamp:
+       mkdir -p lib/perl5/{MO,Sherlock}
+       touch .lib-stamp
+
+lib/perl5/MO/Submit.pm: MO/Submit.pm
+       cp $^ $@
+
+lib/perl5/Sherlock/Object.pm: $(LIBUCW)/lib/perl5/Sherlock/Object.pm
+       cp $^ $@
+
 clean:
        rm -f `find . -name "*~" -or -name "*.[oa]" -or -name "\#*\#" -or -name TAGS -or -name core -or -name .depend -or -name .#*`
        rm -f submitd connect privkey
+       rm -rf lib .lib-stamp
+
+.PHONY: lib