archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / coxeter / repos / community-x86_64 / coxeter-makefile.patch
blob1563b43b271c0b7413b5a475cb6c63c2729eab35
1 diff -druN src/makefile src/makefile
2 --- src/makefile 2013-02-14 18:26:28.000000000 +0100
3 +++ src/makefile 2013-02-15 14:34:54.082756900 +0100
4 @@ -12,6 +12,7 @@
5 gflags = -c $(includedirs) -g
7 cflags = $(gflags) # the default setting
8 +cflags = -c $(includedirs) $(CPPFLAGS) $(CXXFLAGS) -fPIC
10 ifdef optimize
11 NDEBUG = true
12 @@ -22,18 +23,74 @@
13 cflags = $(pflags)
14 endif
16 -cc = g++
17 +EXENAME = coxeter
18 +LIBNAME = coxeter3
19 +ifeq ($(UNAME),Darwin)
20 + EXEEXT =
21 + LIBPREFIX = lib
22 + LIBEXT = .dylib
23 + LIBDIR = lib
24 + LINKFLAGS = -dynamiclib -Wl,-headerpad_max_install_names,-undefined,dynamic_lookup,-compatibility_version,3.0,-current_version,3.0,-install_name,$(SAGE_LOCAL)/lib/$(LIBPREFIX)$(LIBNAME)$(LIBEXT)
25 + LINKLIBS =
26 +else
27 +ifeq ($(UNAME),CYGWIN)
28 + EXEEXT = .exe
29 + LIBPREFIX = cyg
30 + LIBEXT = .dll
31 + LIBDIR = bin
32 + IMPLIB = lib$(LIBNAME).dll.a
33 + LINKFLAGS = -shared -Wl,--out-implib=$(IMPLIB) -Wl,--export-all-symbols
34 + LINKLIBS = -lc
35 +else
36 + EXEEXT =
37 + LIBPREFIX = lib
38 + LIBEXT = .so
39 + LIBDIR = lib
40 + LINKFLAGS = $(LDFLAGS) -shared -Wl,-soname,libcoxeter3.so
41 + LINKLIBS = -lc
42 +endif
43 +endif
44 +LIBRARY = $(LIBPREFIX)$(LIBNAME)$(LIBEXT)
46 -all: coxeter #clean
47 +all: coxeter executable
49 coxeter: $(objects)
50 - $(cc) -o coxeter $(objects)
51 + $(CXX) $(LINKFLAGS) -o $(LIBRARY) $(objects) $(LINKLIBS)
53 +executable: $(objects)
54 + $(CXX) $(LDFLAGS) -o $(EXENAME)$(EXEEXT) $(objects)
56 +DATADIR="$$SAGE_LOCAL/share/coxeter/"
57 +INCLUDEDIR="$$SAGE_LOCAL/include/coxeter/"
58 +LIBRARYDIR="$$SAGE_LOCAL/$(LIBDIR)"
60 +install: coxeter executable
61 + cp $(EXENAME)$(EXEEXT) "$$SAGE_LOCAL/bin/"
62 + cp $(LIBRARY) $(LIBRARYDIR)
63 + if [ $(UNAME) = "CYGWIN" ]; then \
64 + cp $(IMPLIB) "$$SAGE_LOCAL/lib/"; \
65 + fi
67 + mkdir -p $(DATADIR)
68 + cp -r coxeter_matrices headers messages $(DATADIR)
69 + mkdir -p $(INCLUDEDIR)
70 + cp -r *.h *.hpp $(INCLUDEDIR)
72 +check: coxeter executable
73 + $(EXENAME)$(EXEEXT) < test.input > test.output
75 + if ! diff test.output.expected test.output > /dev/null; then \
76 + echo >&2 "Error testing coxeter on test.input:"; \
77 + diff test.output.expected test.output; \
78 + exit 1; \
79 + fi
80 + rm -f test.output
82 clean:
83 rm -f $(objects)
85 %.o:%.cpp
86 - $(cc) $(cflags) $*.cpp
87 + $(CXX) $(cflags) $*.cpp
89 # dependencies --- these were generated automatically by make depend on my
90 # system; they are explicitly copied for portability. Only local dependencies
91 @@ -43,7 +100,7 @@
92 # contents of tmp in lieu of the dependencies listed here.
94 %.d:%.cpp
95 - @$(cc) -MM $*.cpp
96 + @$(CXX) -MM $*.cpp
97 depend: $(dependencies)
99 affine.o: affine.cpp affine.h globals.h coxgroup.h coxtypes.h io.h list.h \