Subversion Repositories f9daq

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
360 f9daq 1
CXX=$(CROSS_COMPILE)g++
2
RM=rm
3
 
4
CXXSOURCES=main.cpp
5
 
6
INCLUDE =  -I$(INSTALL_DIR)/include
7
INCLUDE += -I$(INSTALL_DIR)/include/api2
8
INCLUDE += -I$(INSTALL_DIR)/include/apiApp
9
INCLUDE += -I$(INSTALL_DIR)/rp_sdk
10
INCLUDE += -I$(INSTALL_DIR)/rp_sdk/libjson
11
 
12
LIBS = -L$(INSTALL_DIR)/lib
13
LIBS += -L$(INSTALL_DIR)/rp_sdk
14
 
15
COMMON_FLAGS+=-Wall -fPIC -Os -s
16
CXXFLAGS+=$(COMMON_FLAGS) -std=c++11 $(INCLUDE)
17
LDFLAGS = -shared $(COMMON_FLAGS) $(LIBS)
18
LDFLAGS+= -Wl,--whole-archive,--no-as-needed
19
LDFLAGS+= -lcryptopp -lrpapp -lrp -lrp_sdk
20
LDFLAGS+= -Wl,--no-whole-archive
21
 
22
CXXOBJECTS=$(CXXSOURCES:.cpp=.o)
23
OBJECTS=$(CXXOBJECTS)
24
 
25
OUT_DIR=../
26
C_OUT_NAME=$(OUT_DIR)controllerhf.so
27
 
28
all: make_c_app
29
 
30
.cpp.o:
31
	$(CXX) -c $(CXXFLAGS) $< -o $@
32
 
33
make_c_app: $(OBJECTS)
34
	$(CXX) $(OBJECTS) -o $(C_OUT_NAME) $(LDFLAGS)
35
 
36
clean:
37
	-$(RM) -f $(C_OUT_NAME) $(OBJECTS)