automatic commit
[mlp.git] / Makefile
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..48ecf1b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,42 @@
+
+#  mlp-mnist is an implementation of a multi-layer neural network.
+#
+#  Copyright (c) 2008 Idiap Research Institute, http://www.idiap.ch/
+#  Written by Francois Fleuret <francois.fleuret@idiap.ch>
+#
+#  This file is part of mlp-mnist.
+#
+#  mlp-mnist is free software: you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License version 3 as
+#  published by the Free Software Foundation.
+#
+#  mlp-mnist is distributed in the hope that it will be useful, but
+#  WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with mlp-mnist.  If not, see <http://www.gnu.org/licenses/>.
+
+ifeq ($(DEBUG),yes)
+ CXXFLAGS = -Wall -g
+else
+ # Optimized compilation
+ CXXFLAGS = -Wall -ffast-math -fcaller-saves -finline-functions -funroll-all-loops -O3
+endif
+
+all: ann
+
+ann: ann.o misc.o images.o neural.o
+       $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
+
+Makefile.depend: *.h *.cc Makefile
+       $(CC) -M *.cc > Makefile.depend
+
+clean:
+       \rm ann *.o Makefile.depend
+
+archive:
+       cd .. ; tar zcvf mlp-mnist.tgz mlp-mnist/{*.{cc,h,txt,sh},Makefile}
+
+-include Makefile.depend