1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
Description: Fix Makefile
Add an install target, use the implicit rules
Author: Nicolas Bourdaud <nicolas.bourdaud@gmail.com>
Origin: vendor
Forwarded: no
Last-Update: 2012-05-11
--- a/Makefile
+++ b/Makefile
@@ -17,3 +17,7 @@
realclean: clean
(cd src; make realclean)
+
+install:
+ mkdir -p $(DESTDIR)/usr/bin
+ install mwrap $(DESTDIR)/usr/bin
--- a/make.inc
+++ b/make.inc
@@ -10,8 +10,8 @@
# Uncomment this line for C99 complex support
TESTC99COMPLEX=test_c99_complex
-CC= gcc
-CXX= g++
+#CC= gcc
+#CXX= g++
MEX= mex $(OOFLAG)
# Use the following for 64-bit MEX
--- a/src/Makefile
+++ b/src/Makefile
@@ -4,40 +4,31 @@
# === Primary targets ===
../mwrap: mwrap.o lex.yy.o mwrap-ast.o mwrap-typecheck.o \
- mwrap-mgen.o mwrap-cgen.o mwrap-ast.h
- $(CXX) -o ../mwrap mwrap.o mwrap-ast.o \
- mwrap-typecheck.o mwrap-mgen.o mwrap-cgen.o \
- lex.yy.o
+ mwrap-mgen.o mwrap-cgen.o
+ $(CXX) $(LDFLAGS) -o $@ $^
-mwrap.o: mwrap.cc lex.yy.c mwrap-ast.h
- $(CXX) -c mwrap.cc
+mwrap.o: mwrap.cc mwrap-ast.h
mwrap.cc: mwrap.y
$(BISON) -d -v mwrap.y -o mwrap.cc
lex.yy.o: lex.yy.c
- $(CC) -c lex.yy.c
lex.yy.c: mwrap.l
$(FLEX) mwrap.l
mwrap-ast.o: mwrap-ast.cc mwrap-ast.h
- $(CXX) -c -g mwrap-ast.cc
mwrap-typecheck.o: mwrap-typecheck.cc mwrap-ast.h
- $(CXX) -c -g mwrap-typecheck.cc
mwrap-cgen.o: mwrap-cgen.cc mwrap-ast.h mwrap-support.h
- $(CXX) -c -g mwrap-cgen.cc
mwrap-mgen.o: mwrap-mgen.cc mwrap-ast.h
- $(CXX) -c -g mwrap-mgen.cc
mwrap-support.h: mwrap-support.c stringify
./stringify mex_header < mwrap-support.c > mwrap-support.h
stringify: stringify.c
- gcc -o stringify stringify.c
# === Clean-up targets ===
@@ -49,4 +40,3 @@
realclean: clean
rm -f lex.yy.c mwrap.cc mwrap.hh mwrap-support.h mwrap.pdf
-
--- a/testing/Makefile
+++ b/testing/Makefile
@@ -25,11 +25,11 @@
$(MEX) test_c99_complexmex.c
test_syntax:
- - ../mwrap -cppcomplex test_syntax.mw >& test_syntax.log
+ - ../mwrap -cppcomplex test_syntax.mw 2> test_syntax.log
diff test_syntax.log test_syntax.ref
test_typecheck:
- - ../mwrap -cppcomplex test_typecheck.mw >& test_typecheck.log
+ - ../mwrap -cppcomplex test_typecheck.mw 2> test_typecheck.log
diff test_typecheck.log test_typecheck.ref
test_catch:
@@ -63,9 +63,11 @@
$(MEX) test_includemex.cc
clean:
- rm -f *~ *.mex* *.o* test_typecheck.log
+ rm -f *~ *.mex* *.o* test_typecheck.log test_syntax.log
rm -f test_fortran1.m test_fortran2.m test_transfers.m test_catch.m
+ rm -f test_fortran1mex.cc test_fortran2mex.c
rm -f test_cpp_complex.m test_c99_complex.m
rm -f test_transfersmex.cc test_catchmex.cc test_fortranmex.cc
rm -f test_cpp_complexmex.cc test_c99_complexmex.c
rm -f test_redirect.m test_redirect1.m
+ rm -f test_include.m test_includemex.cc
|