Skip to content

Commit 5686ccd

Browse files
author
xedaq
committed
Makefile modification, some jank involved
1 parent 6f9eea6 commit 5686ccd

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

CControl_Handler.cc

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
#include "CControl_Handler.hh"
22
#include "DAXHelpers.hh"
33
#include "V2718.hh"
4+
#ifdef HASDDC10
45
#include "DDC10.hh"
6+
#endif
57
#include "V1495.hh"
68
#include <bsoncxx/builder/stream/document.hpp>
79

810
CControl_Handler::CControl_Handler(std::shared_ptr<MongoLog>& log, std::string procname) : DAQController(log, procname){
911
fCurrentRun = fBID = fBoardHandle-1;
1012
fV2718 = nullptr;
1113
fV1495 = nullptr;
14+
#ifdef HASDDC10
1215
fDDC10 = nullptr;
16+
#endif
1317
fStatus = DAXHelpers::Idle;
1418
}
1519

@@ -60,6 +64,7 @@ int CControl_Handler::Arm(std::shared_ptr<Options>& opts){
6064
fBoardHandle = fV2718->GetHandle();
6165
fLog->Entry(MongoLog::Local, "V2718 Initialized");
6266

67+
#ifdef HASDDC10
6368
// Getting options for DDC10 HEV module
6469
std::vector<BoardType> dv = fOptions->GetBoards("DDC10");
6570
if (dv.size() == 1){
@@ -78,6 +83,7 @@ int CControl_Handler::Arm(std::shared_ptr<Options>& opts){
7883
}
7984
} else {
8085
}
86+
#endif // HASDDC10
8187

8288
std::vector<BoardType> mv = fOptions->GetBoards("V1495");
8389
if (mv.size() == 1){
@@ -124,9 +130,11 @@ int CControl_Handler::Stop(){
124130
}
125131
fV2718.reset();
126132
}
133+
fV1495.reset();
134+
#ifdef HASDDC10
127135
// Don't need to stop the DDC10 but just clean up a bit
128136
fDDC10.reset();
129-
fV1495.reset();
137+
#endif
130138

131139
fStatus = DAXHelpers::Idle;
132140
return 0;

CControl_Handler.hh

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
#include "DAQController.hh"
55

66
class V2718;
7-
class DDC10;
87
class V1495;
8+
#ifdef HASDDC10
9+
class DDC10;
10+
#endif
911

1012
class CControl_Handler : public DAQController{
1113
public:
@@ -20,8 +22,10 @@ public:
2022
private:
2123

2224
std::unique_ptr<V2718> fV2718;
23-
std::unique_ptr<DDC10> fDDC10;
2425
std::unique_ptr<V1495> fV1495;
26+
#ifdef HASDDC10
27+
std::unique_ptr<DDC10> fDDC10;
28+
#endif
2529

2630
int fStatus;
2731
int fCurrentRun;

Makefile

+14-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,26 @@ CC = g++
33
CXX = g++
44
CFLAGS = -Wall -Wextra -pedantic -pedantic-errors -g -DLINUX -std=c++17 -pthread $(shell pkg-config --cflags libmongocxx)
55
CPPFLAGS := $(CFLAGS)
6-
LDFLAGS = -lCAENVME -lstdc++fs -llz4 -lblosc $(shell pkg-config --libs libmongocxx) $(shell pkg-config --libs libbsoncxx) -lexpect -ltcl8.6
6+
IS_READER0 := false
7+
ifeq "$(shell hostname)" "reader0"
8+
IS_READER0 = true
9+
endif
10+
LDFLAGS = -lCAENVME -lstdc++fs -llz4 -lblosc $(shell pkg-config --libs libmongocxx) $(shell pkg-config --libs libbsoncxx)
711
#LDFLAGS_CC = ${LDFLAGS} -lexpect -ltcl8.6
812

9-
SOURCES_SLAVE = $(wildcard *.cc)
13+
SOURCES_SLAVE = CControl_Handler.cc DAQController.cc f1724.cc main.cc MongoLog.cc \
14+
Options.cc StraxFormatter.cc V1495.cc V1724.cc V1724_MV.cc \
15+
V1730.cc V2718.cc
1016
OBJECTS_SLAVE = $(SOURCES_SLAVE:%.cc=%.o)
1117
DEPS_SLAVE = $(OBJECTS_SLAVE:%.o=%.d)
1218
EXEC_SLAVE = redax
1319

20+
ifeq "$(IS_READER0)" "true"
21+
SOURCES_SLAVE += DDC10.cc
22+
CFLAGS += -DHASDDC10
23+
LDFLAGS += -lexpect -ltcl8.6
24+
endif
25+
1426
all: $(EXEC_SLAVE)
1527

1628
$(EXEC_SLAVE) : $(OBJECTS_SLAVE)

0 commit comments

Comments
 (0)