[65] | 1 | TARGET := ../lib/atnf_sd.so
|
---|
[2] | 2 |
|
---|
[65] | 3 | CXX := g++-3.2.3
|
---|
| 4 | CXXFLAGS := -O -fPIC
|
---|
[71] | 5 | CXXFLAGS += -fpermissive # This should be removed.
|
---|
[65] | 6 | #CXXFLAGS += -ansi
|
---|
| 7 | #CXXFLAGS += -pedantic -Wno-long-long
|
---|
| 8 | #CXXFLAGS += -Wall -Wno-parentheses
|
---|
[2] | 9 |
|
---|
[71] | 10 | CFITSIOLIB := /usr/local/lib/libcfitsio.a #-lcfitsio
|
---|
[72] | 11 | CFITSIOINC := -I/usr/local/include/cfitsio
|
---|
[71] | 12 |
|
---|
[65] | 13 | AIPSROOT := $(word 1, $(AIPSPATH))
|
---|
| 14 | AIPSINC := -I$(AIPSROOT)/code/include
|
---|
| 15 | AIPSLIB := $(AIPSROOT)/linux_gnu/lib
|
---|
| 16 | AIPSPPLIB := $(AIPSLIB)/version.o \
|
---|
[71] | 17 | -L$(AIPSLIB) -latnf -ltrial -laips -laips_f \
|
---|
| 18 | $(AIPSLIB)/libwcs.a \
|
---|
| 19 | -lrpfits $(CFITSIOLIB) -llapack -lblas -lg2c
|
---|
[2] | 20 |
|
---|
[65] | 21 | LD := g++-3.2.3
|
---|
| 22 | LDFLAGS := -shared -Wl,--soname=$(TARGET)
|
---|
| 23 | LDFLAGS += -s
|
---|
[2] | 24 |
|
---|
[77] | 25 | BOOSTLIB := /nfs/atapplic/boost/linux/lib/libboost_python2.3-gcc-mt.a
|
---|
[65] | 26 | BOOSTINC :=
|
---|
[2] | 27 |
|
---|
[77] | 28 | PYTHONINC := -I/usr/local/include/python2.3
|
---|
| 29 | PYTHONLIB := -lpython2.3
|
---|
[2] | 30 |
|
---|
[65] | 31 | INCDIRS := -I. $(AIPSINC) $(BOOSTINC) $(PYTHONINC) $(CFITSIOINC)
|
---|
| 32 | LIBS := $(BOOSTLIB) $(PYTHONLIB) $(AIPSPPLIB)
|
---|
[2] | 33 |
|
---|
[65] | 34 | OBJECTS := MathUtils.o \
|
---|
| 35 | SDContainer.o \
|
---|
| 36 | SDMemTable.o \
|
---|
| 37 | SDReader.o \
|
---|
| 38 | SDWriter.o \
|
---|
| 39 | SDMath.o \
|
---|
| 40 | SDTemplates.o \
|
---|
| 41 | python_SDMemTable.o \
|
---|
| 42 | python_SDReader.o \
|
---|
| 43 | python_SDWriter.o \
|
---|
| 44 | python_SDMath.o \
|
---|
| 45 | python_SD.o
|
---|
[31] | 46 |
|
---|
[2] | 47 |
|
---|
[65] | 48 | HEADERS := SDContainer.h \
|
---|
| 49 | SDMemTable.h \
|
---|
| 50 | SDReader.h \
|
---|
| 51 | SDWriter.h \
|
---|
| 52 | SDMath.h \
|
---|
| 53 | SDMemTableWrapper.h \
|
---|
| 54 | SDMathWrapper.h \
|
---|
| 55 | SDReaderWrapper.h \
|
---|
| 56 | SDWriterWrapper.h \
|
---|
| 57 | python_SD.h
|
---|
[2] | 58 |
|
---|
| 59 | .SUFFIXES: .c .o .cpp .cc .cxx .C
|
---|
| 60 |
|
---|
| 61 | .cpp.o:
|
---|
[65] | 62 | -@ echo
|
---|
| 63 | $(CXX) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 64 |
|
---|
| 65 | .cc.o:
|
---|
[65] | 66 | -@ echo
|
---|
| 67 | $(CXX) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 68 |
|
---|
[65] | 69 | .cxx.o:
|
---|
| 70 | -@ echo
|
---|
| 71 | $(CXX) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 72 |
|
---|
| 73 | .C.o:
|
---|
[65] | 74 | -@ echo
|
---|
| 75 | $(CXX) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 76 |
|
---|
| 77 |
|
---|
[65] | 78 | .PHONY : all clean objects realclean relink
|
---|
[2] | 79 |
|
---|
[65] | 80 | all : $(TARGET)
|
---|
| 81 |
|
---|
| 82 | relink : cleanso $(TARGET)
|
---|
| 83 |
|
---|
| 84 | objects : $(OBJECTS)
|
---|
| 85 |
|
---|
| 86 | $(TARGET) : $(OBJECTS)
|
---|
| 87 | -@ echo
|
---|
| 88 | $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
|
---|
| 89 |
|
---|
| 90 | $(OBJECTS) : $(HEADERS)
|
---|
| 91 |
|
---|
| 92 | clean :
|
---|
[2] | 93 | -rm -f $(OBJECTS)
|
---|
| 94 |
|
---|
[65] | 95 | cleanso :
|
---|
[2] | 96 | -rm -f $(TARGET)
|
---|
[65] | 97 |
|
---|
| 98 | realclean : clean cleanso
|
---|