Commit f297d9e8 authored by seb's avatar seb

change Makefile to manage dependancies


git-svn-id: https://scm.blissgarden.org/svn/lima/trunk@162 45c4679d-1946-429d-baad-37912b19538b
parent fa187781
......@@ -3,7 +3,8 @@ lima-objs := ../common/src/Common.o \
../control/src/Ct.o \
../camera/simulator/src/Simu.o \
../camera/common/espia/src/Espia.o \
../camera/frelon/src/Frelon.o
../camera/frelon/src/Frelon.o \
../camera/maxipix/src/Maxipix.o
include ../camera/common/espia/include/espia.inc
......
SRCS = EspiaBase.cpp EspiaDev.cpp EspiaAcq.cpp EspiaSerialLine.cpp \
EspiaBufferMgr.cpp EspiaFocla.cpp FoclaHwInterface.cpp
espia-objs = EspiaBase.o EspiaDev.o EspiaAcq.o EspiaSerialLine.o \
EspiaBufferMgr.o EspiaFocla.o FoclaHwInterface.o
......@@ -8,7 +11,7 @@ CXXFLAGS = -I../include \
-I../../../../hardware/include -I../../../../common/include \
-I$(ESPIA_DRV_INCL) -Wall -pthread -fPIC
all: clean Espia.o
all: Espia.o
Espia.o: $(espia-objs)
$(LD) -o $@ -r $+
......@@ -18,3 +21,12 @@ EspiaBase.o: Espia.cpp
clean:
rm -f *.o
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
\ No newline at end of file
SRCS = testfocla.cpp testfoclahwinterface.cpp
focla-objs = ../src/Espia.o \
../../../../hardware/src/Hw.o ../../../../common/src/Common.o
......@@ -14,7 +15,7 @@ CXXFLAGS = -I../include \
-I../../../../third-party/Processlib/core/include \
-I$(ESPIA_DRV_INCL) -Wall -pthread
all: clean testfocla testfoclahwinterface
all: testfocla testfoclahwinterface
testfocla: testfocla.o $(focla-objs)
$(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
......@@ -25,3 +26,11 @@ testfoclahwinterface: testfoclahwinterface.o $(focla-objs)
clean:
rm -f *.o testfocla testfoclahwinterface
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
\ No newline at end of file
include ../../common/espia/include/espia.inc
SRCS = FrelonBase.cpp FrelonSerialLine.cpp FrelonCamera.cpp FrelonInterface.cpp
frelon-objs = FrelonBase.o FrelonSerialLine.o FrelonCamera.o FrelonInterface.o
CXXFLAGS = -I../include -I../../common/espia/include \
-I../../../hardware/include -I../../../common/include \
-I$(ESPIA_DRV_INCL) -Wall -pthread -fPIC
all: clean Frelon.o
all: Frelon.o
Frelon.o: $(frelon-objs)
$(LD) -o $@ -r $+
......@@ -17,3 +18,12 @@ FrelonBase.o: Frelon.cpp
clean:
rm -f *.o
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
\ No newline at end of file
SRCS = ./src/Frelon.cpp ../../common/espia/src/Espia.cpp \
../../../hardware/src/Hw.cpp ../../../common/src/Common.cpp
frelon-objs = ../src/Frelon.o ../../common/espia/src/Espia.o \
../../../hardware/src/Hw.o ../../../common/src/Common.o
......@@ -15,7 +17,7 @@ CXXFLAGS = -I../include -I../../common/espia/include \
-I../../../third-party/Processlib/tasks/include \
-I$(ESPIA_DRV_INCL) -Wall -pthread
all: clean testfrelon testfreloninterface
all: testfrelon testfreloninterface
testfrelon: testfrelon.o $(frelon-objs)
$(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
......@@ -25,3 +27,12 @@ testfreloninterface: testfreloninterface.o $(frelon-objs)
clean:
rm -f *.o testfrelon testfreloninterface
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
\ No newline at end of file
......@@ -19,6 +19,7 @@ namespace lima
~MaxipixReconstruction();
void setType(Type);
void setModel(Model);
void setXnYGapSpace(int xSpace,int ySpace);
virtual Data process(Data &aData);
private:
......
......@@ -9,13 +9,14 @@ using namespace lima;
%End
public:
enum Type {RAW,ZERO,DISPATCH,MEAN};
enum Model {M_4x4,M_5x1};
enum Model {M_2x2,M_5x1};
explicit MaxipixReconstruction(Model = M_5x1,
Type = RAW);
MaxipixReconstruction(const Maxipix::MaxipixReconstruction&);
~MaxipixReconstruction();
void setType(Type);
void setModel(Model);
void setXnYGapSpace(int xSpace,int ySpace);
virtual Data process(Data &aData);
};
......
SRCS = MaxipixReconstruction.cpp
maxipix-objs := MaxipixReconstruction.o
SRCS = MaxipixReconstruction.cpp
INCLUDES = -I../include \
-I../../../third-party/Processlib/core/include
......
......@@ -111,10 +111,10 @@ COPY_5x1
//----------------------------------------------------------------------------
static inline void copy_2x2(Data &src,Buffer *dst,int xSpace,int ySpace)
{
int aTotalWidth = (MAXIPIX_NB_COLUMN * 2) + xSpace;
int aTotalHeight = (MAXIPIX_NB_LINE * 2) + ySpace;
unsigned short *aSrcPt = (unsigned short*)src.data();
unsigned short *aDstPt = ((unsigned short*)dst->data) +
(((MAXIPIX_LINE_SIZE + xSpace) * (MAXIPIX_NB_LINE + (ySpace >> 1))) << 1) -
MAXIPIX_LINE_SIZE;
unsigned short *aDstPt = ((unsigned short*)dst->data) + (aTotalWidth * aTotalHeight) - aTotalWidth;
int aJump2LeftChip = MAXIPIX_LINE_SIZE + xSpace - 1;
......@@ -155,7 +155,7 @@ static inline void copy_2x2(Data &src,Buffer *dst,int xSpace,int ySpace)
static inline void _raw_2x2(Data &src,Buffer *dst,int xSpace,int ySpace)
{
unsigned short *aDstPt = ((unsigned short*)dst->data) + MAXIPIX_NB_COLUMN;
for(int i = MAXIPIX_NB_LINE;i;--i,aDstPt += MAXIPIX_LINE_SIZE)
for(int i = MAXIPIX_NB_LINE;i;--i,aDstPt += (MAXIPIX_LINE_SIZE + xSpace))
for(int k = 0;k < xSpace;++k)
aDstPt[k] = 0;
......@@ -281,6 +281,33 @@ static inline void _mean_2x2(Data &src,Buffer *dst,int xSpace,int ySpace)
copy_2x2(src,dst,xSpace,ySpace);
}
MaxipixReconstruction::MaxipixReconstruction(MaxipixReconstruction::Model aModel,
MaxipixReconstruction::Type aType) :
mType(aType),mModel(aModel),mXSpace(4),mYSpace(4)
{
}
MaxipixReconstruction::MaxipixReconstruction(const MaxipixReconstruction &other) :
mType(other.mType),mModel(other.mModel),
mXSpace(other.mXSpace),mYSpace(other.mYSpace)
{
}
MaxipixReconstruction::~MaxipixReconstruction()
{
}
void MaxipixReconstruction::setType(MaxipixReconstruction::Type aType)
{
mType = aType;
}
void MaxipixReconstruction::setXnYGapSpace(int xSpace,int ySpace)
{
mXSpace = xSpace,mYSpace = ySpace;
}
Data MaxipixReconstruction::process(Data &aData)
{
Data aReturnData;
......@@ -288,6 +315,7 @@ Data MaxipixReconstruction::process(Data &aData)
if(mModel == M_5x1)
{
aReturnData.width = MAXIPIX_NB_COLUMN * 5 + 4 * mXSpace;
if(!_processingInPlaceFlag)
{
Buffer *aNewBuffer = new Buffer((MAXIPIX_LINE_SIZE * 5 + (mXSpace << 1) * 4) *
......@@ -310,8 +338,10 @@ Data MaxipixReconstruction::process(Data &aData)
}
else // Model 2x2
{
int aBufferSize = ((MAXIPIX_LINE_SIZE + mXSpace) * 2) *
((MAXIPIX_NB_LINE + mYSpace) * 2);
aReturnData.width = MAXIPIX_NB_COLUMN * 2 + mXSpace;
aReturnData.height = MAXIPIX_NB_LINE * 2 + mYSpace;
int aBufferSize = aReturnData.width * aReturnData.height;
Buffer *aNewBuffer = new Buffer(aBufferSize);
switch(mType)
{
......@@ -332,10 +362,10 @@ Data MaxipixReconstruction::process(Data &aData)
unsigned char *aSrcPt = (unsigned char*)aNewBuffer->data;
unsigned char *aDstPt = (unsigned char*)aData.data();
memcpy(aDstPt,aSrcPt,aBufferSize);
aNewBuffer->unref();
}
else
aReturnData.setBuffer(aNewBuffer);
aNewBuffer->unref();
}
return aReturnData;
......
SRCS = FrameBuilder.cpp Simulator.cpp SimuHwInterface.cpp
simu-objs = FrameBuilder.o Simulator.o SimuHwInterface.o
CXX = g++
INC = -I../include -I../../../common/include -I../../../hardware/include
CXXFLAGS += $(INC) -Wall -pthread -fPIC
all: clean Simu.o
all: Simu.o
Simu.o: $(simu-objs)
$(LD) -o $@ -r $+
clean:
rm -f Simu.o $(simu-objs)
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
\ No newline at end of file
SRCS = test.cpp testsimulator.cpp testsimuhwinterface.cpp
std-objs = ../../../common/src/Common.o ../../../hardware/src/Hw.o
simu-objs = ../src/Simu.o
test-objs = test.o
test-ext-objs = $(simu-objs)
testsimulator-objs = testsimulator.o
testsimulator-ext-objs = $(simu-objs) $(std-objs)
......@@ -15,7 +16,7 @@ INC = -I../include -I../../../common/include -I../../../hardware/include
CXXFLAGS += $(INC) -Wall -pthread
LDFLAGS = -pthread
all: clean test testsimulator testsimuhwinterface
all: test testsimulator testsimuhwinterface
test: $(test-objs)
$(CXX) $(LDFLAGS) -o $@ $+ $(test-ext-objs) $(std-objs)
......@@ -31,3 +32,11 @@ clean:
rm -f $(testsimulator-objs) testsimulator
rm -f $(testsimuhwinterface-objs) testsimuhwinterface
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
\ No newline at end of file
SRCS = Constants.cpp SizeUtils.cpp Timestamp.cpp ThreadUtils.cpp Exceptions.cpp \
BufferSave.cpp MemUtils.cpp RegEx.cpp AcqFinished.cpp
common-objs := Constants.o SizeUtils.o Timestamp.o ThreadUtils.o Exceptions.o \
BufferSave.o MemUtils.o RegEx.o AcqFinished.o
CXXFLAGS += -I../include -I../../hardware/include -Wall -pthread -fPIC
all: clean Common.o
all: Common.o
Common.o: $(common-objs)
ld -o $@ -r $+
......@@ -12,3 +14,12 @@ Common.o: $(common-objs)
clean:
rm -f Common.o $(common-objs)
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
\ No newline at end of file
SRCS = testregex.cpp
CXXFLAGS = -Wall -I ../include -pthread
LDFLAGS = -pthread
all: clean testregex
all: testregex
testregex: testregex.o ../src/Common.o
$(CXX) $(LDFLAGS) -o $@ $+
clean:
rm -f *.o testregex
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
\ No newline at end of file
SRCS = simutest.cpp
lima-objs = ../../common/src/Common.o ../../hardware/src/Hw.o ../src/Ct.o
simu-objs = ../../camera/simulator/src/Simu.o
......@@ -14,7 +14,7 @@ CXXFLAGS += $(INC) -g -Wall -pthread
LDFLAGS = -pthread
LDLIBS = -L../../third-party/Processlib/build -lprocesslib
all: clean simutest
all: simutest
simutest: $(simutest-objs)
$(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS) $(simutest-ext-objs)
......@@ -23,3 +23,11 @@ simutest: $(simutest-objs)
clean:
rm -f $(simutest-objs) simutest
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
\ No newline at end of file
SRCS = HwInterface.cpp HwCap.cpp HwSyncCtrlObj.cpp HwFrameInfo.cpp \
HwFrameCallback.cpp HwBufferCtrlObj.cpp HwBufferMgr.cpp \
HwShutterCtrlObj.cpp HwDetInfoCtrlObj.cpp HwBinCtrlObj.cpp \
HwRoiCtrlObj.cpp HwSerialLine.cpp
hw-objs := HwInterface.o HwCap.o HwSyncCtrlObj.o HwFrameInfo.o \
HwFrameCallback.o HwBufferCtrlObj.o HwBufferMgr.o \
HwShutterCtrlObj.o HwDetInfoCtrlObj.o HwBinCtrlObj.o \
HwRoiCtrlObj.o HwSerialLine.o
CXXFLAGS += -I../include -I../../common/include -Wall -pthread -fPIC
all: clean Hw.o
all: Hw.o
Hw.o: $(hw-objs)
ld -o $@ -r $+
clean:
rm -f Hw.o $(hw-objs)
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment