-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·144 lines (117 loc) · 3.67 KB
/
Makefile
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#####################################################################
#
# Name: Makefile
#
#####################################################################
#
#--------------------------------------------------------------------
# The MIDASSYS should be defined prior the use of this Makefile
ifndef MIDASSYS
missmidas::
@echo "...";
@echo "Missing definition of environment variable 'MIDASSYS' !";
@echo "...";
endif
#--------------------------------------------------------------------
# The following lines contain specific switches for different UNIX
# systems. Find the one which matches your OS and outcomment the
# lines below.
#-----------------------------------------
# This is for Linux
ifeq ($(OSTYPE),Linux)
OSTYPE = linux
endif
#ifeq ($(OSTYPE),linux)
OS_DIR = linux-m64
OSFLAGS = -DOS_LINUX
CFLAGS = -g -O2 -Wall -fpermissive -std=c++11
LIBS = -lm -lz -lutil -lnsl -lrt -lpthread -ldl
#endif
#-----------------------
# MacOSX/Darwin is just a funny Linux
#
ifeq ($(OSTYPE),Darwin)
OSTYPE = darwin
endif
ifeq ($(OSTYPE),darwin)
OS_DIR = darwin
FF = cc
OSFLAGS = -DOS_LINUX -DOS_DARWIN -DHAVE_STRLCPY -DAbsoftUNIXFortran -fPIC -Wno-unused-function
LIBS = -lpthread -lrt
SPECIFIC_OS_PRG = $(BIN_DIR)/mlxspeaker
NEED_STRLCPY=
NEED_RANLIB=1
NEED_SHLIB=
NEED_RPATH=
endif
#-----------------------------------------
# ROOT flags and libs
#
ifdef ROOTSYS
ROOTCFLAGS := $(shell $(ROOTSYS)/bin/root-config --cflags)
ROOTCFLAGS += -DHAVE_ROOT -DUSE_ROOT
ROOTLIBS := $(shell $(ROOTSYS)/bin/root-config --libs) -Wl,-rpath,$(ROOTSYS)/lib
ROOTLIBS += -lThread
else
missroot:
@echo "...";
@echo "Missing definition of environment variable 'ROOTSYS' !";
@echo "...";
endif
#-------------------------------------------------------------------
# The following lines define directories. Adjust if necessary
#
MIDAS_INC = $(MIDASSYS)/include
MIDAS_LIB = $(MIDASSYS)/lib
MIDAS_SRC = $(MIDASSYS)/src
MIDAS_DRV = $(MIDASSYS)/drivers/vme
# Hardware driver can be (camacnul, kcs2926, kcs2927, hyt1331)
#
DRIVERS =
#-------------------------------------------------------------------
# Frontend code name defaulted to frontend in this example.
# comment out the line and run your own frontend as follow:
# gmake UFE=my_frontend
#
UFE = febrb
####################################################################
# Lines below here should not be edited
####################################################################
#
# compiler
CC = gcc
CXX = g++
#
# MIDAS library
LIBMIDAS = -L$(MIDAS_LIB) -lmidas
#
#
# All includes
INCS = -I. -I$(MIDAS_INC) -I$(MIDAS_DRV)
all: $(UFE).exe feudp.exe
feudp.exe: $(LIB) $(MIDAS_LIB)/mfe.o $(DRIVERS) feudp.o
$(CXX) $(CFLAGS) $(OSFLAGS) $(INCS) -o feudp.exe feudp.o $(DRIVERS) \
$(MIDAS_LIB)/mfe.o $(LIBMIDAS) $(LIBS)
feodbxx_test.exe: $(LIB) $(MIDAS_LIB)/mfe.o $(DRIVERS) feodbxx_test.o
$(CXX) $(CFLAGS) $(OSFLAGS) $(INCS) -o feodbxx_test.exe feodbxx_test.o $(DRIVERS) \
$(MIDAS_LIB)/mfe.o $(LIBMIDAS) $(LIBS)
feudp.o: feudp.cxx
$(CXX) $(CFLAGS) $(INCS) $(OSFLAGS) -o $@ -c $<
feodbxx_test.o: feodbxx_test.cxx
$(CXX) $(CFLAGS) $(INCS) $(OSFLAGS) -o $@ -c $<
$(UFE).exe: $(LIB) $(MIDAS_LIB)/mfe.o $(DRIVERS) KOsocket.o PMTControl.o $(UFE).o
$(CXX) $(CFLAGS) $(OSFLAGS) $(INCS) -o $(UFE).exe $(UFE).o $(DRIVERS) \
$(MIDAS_LIB)/mfe.o KOsocket.o PMTControl.o $(LIBMIDAS) $(LIBS)
febrb.o: febrb.cxx
$(CXX) $(CFLAGS) $(INCS) $(OSFLAGS) -o $@ -c $<
KOsocket.o: KOsocket.cxx
$(CXX) $(CFLAGS) $(INCS) $(OSFLAGS) -o $@ -c $<
PMTControl.o: PMTControl.cxx
$(CXX) $(CFLAGS) $(INCS) $(OSFLAGS) -o $@ -c $<
$(MIDAS_LIB)/mfe.o:
@cd $(MIDASSYS) && make
# %.o: %.cxx
# $(CXX) $(USERFLAGS) $(CFLAGS) $(OSFLAGS) $(INCS) -o $@ -c $<
clean::
rm -f *.exe *.o *~ \#*
#end file