Makefile 5.89 KB
Newer Older
Holger Witsch's avatar
Holger Witsch committed
1 2 3 4 5 6
#=============================================================================
#
# file :        Makefile
#
# description : Makefile to generate a TANGO device server.
#
7
# project :     Fpga
Holger Witsch's avatar
Holger Witsch committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21
#
#=============================================================================
#                This file is generated by POGO
#        (Program Obviously used to Generate tango Object)
#=============================================================================
#
#
# MAKE_ENV is the path to find common environment to buil project
#
MAKE_ENV = /segfs/tango/cppserver/env

#=============================================================================
# PACKAGE_NAME is the name of the library/device/exe you want to build
#
22
PACKAGE_NAME = Fpga
Holger Witsch's avatar
Holger Witsch committed
23 24 25 26 27 28 29 30 31
MAJOR_VERS   = 1
MINOR_VERS   = 0
RELEASE      = Release_$(MAJOR_VERS)_$(MINOR_VERS)

# #=============================================================================
# # RELEASE_TYPE
# # - DEBUG     : debug symbols - no optimization
# # - OPTIMIZED : no debug symbols - optimization level set to O2
# #-----------------------------------------------------------------------------
32
RELEASE_TYPE = DEBUG
Holger Witsch's avatar
Holger Witsch committed
33 34 35 36 37 38 39 40 41 42

#=============================================================================
# OUTPUT_TYPE can be one of the following :
#   - 'STATIC_LIB' for a static library (.a)
#   - 'SHARED_LIB' for a dynamic library (.so)
#   - 'DEVICE' for a device server (will automatically include and link
#            with Tango dependencies)
#   - 'SIMPLE_EXE' for an executable with no dependency (for exemple the test tool
#                of a library with no Tango dependencies)
#
43
OUTPUT_TYPE = DEVICE
Holger Witsch's avatar
Holger Witsch committed
44 45 46 47

#=============================================================================
# OUTPUT_DIR  is the directory which contains the build result.
# if not set, the standard location is :
48
#	- ./lib   if OUTPUT_TYPE is SHARED_LIB or STATIC_LIB
Holger Witsch's avatar
Holger Witsch committed
49 50 51 52 53 54 55 56 57 58
#	- ./bin for others
#
#OUTPUT_DIR =


#=============================================================================
# INC_DIR_USER is the list of all include path needed by your sources
#   - for a device server, tango dependencies are automatically appended
#   - '-I ../include' and '-I .' are automatically appended in all cases
#
59
INC_DIR_USER=-I Sps/Include -I Sps/Src
Holger Witsch's avatar
Holger Witsch committed
60 61 62 63 64 65

#=============================================================================
# LIB_DIR_USER is the list of user library directories
#   - for a device server, tango libraries directories are automatically appended
#   - '-L ../lib' is automatically appended in all cases
#
66
LIB_DIR_USER=-L lib/debian9 -ladq
Holger Witsch's avatar
Holger Witsch committed
67 68 69 70 71 72 73

#=============================================================================
# LFLAGS_USR is the list of user link flags
#   - for a device server, tango libraries directories are automatically appended
#   - '-ldl -lpthread' is automatically appended in all cases
#
# !!! ATTENTION !!!
74
# Be aware that the order matters.
Holger Witsch's avatar
Holger Witsch committed
75 76 77 78
# For example if you must link with libA, and if libA depends itself on libB
# you must use '-lA -lB' in this order as link flags, otherwise you will get
# 'undefined reference' errors
#
79
#LFLAGS_USR+=
Holger Witsch's avatar
Holger Witsch committed
80 81 82 83 84 85 86 87


#=============================================================================
# CXXFLAGS_USR lists the compilation flags specific for your library/device/exe
# This is the place where to put your compile-time macros using '-Dmy_macro'
#
# -DACE_HAS_EXCEPTIONS -D__ACE_INLINE__ for ACE
#
88
CXXFLAGS_USR+= -DLINUX
Holger Witsch's avatar
Holger Witsch committed
89 90 91


#=============================================================================
92
# TANGO_REQUIRED
Holger Witsch's avatar
Holger Witsch committed
93 94 95 96
# - TRUE  : your project depends on TANGO
# - FALSE : your project does not depend on TANGO
#-----------------------------------------------------------------------------
# - NOTE : if PROJECT_TYPE is set to DEVICE, TANGO will be auto. added
97
#-----------------------------------------------------------------------------
Holger Witsch's avatar
Holger Witsch committed
98 99 100 101 102 103 104 105 106 107 108 109
TANGO_REQUIRED = TRUE



#=============================================================================
#	include Standard TANGO compilation options
#
include $(MAKE_ENV)/tango.opt

#=============================================================================
#	POST_PROCESSING: action to be done after normal make.
#	e.g.:  change executable file name, .....
110
# POST_PROCESSING = \
111 112 113
# 	cp -p bin/$(BIN_DIR)/$(PACKAGE_NAME) ~blissadm/server/$(BIN_DIR)/$(PACKAGE_NAME)
POST_PROCESSING = \
	@echo "\n\nCopying executable to target machine ... ";\
114 115
	echo "$(OUTPUT_DIR)/$(PROJECT_NAME)   TO     blissadm@ld28nano:/users/blissadm/server/debian9"; \
	scp -p $(OUTPUT_DIR)/$(PROJECT_NAME) blissadm@ld28nano:/users/blissadm/server/debian9
Holger Witsch's avatar
Holger Witsch committed
116

117 118 119 120
SPS_DIR = Sps
SPS_SRC = $(SPS_DIR)/Src
SPS_INC = $(SPS_DIR)/Include

Holger Witsch's avatar
Holger Witsch committed
121 122 123
#=============================================================================
# SVC_OBJS is the list of all objects needed to make the output
#
124
SVC_INCL =  $(PACKAGE_NAME).h $(PACKAGE_NAME)Class.h Numbat.h
Holger Witsch's avatar
Holger Witsch committed
125 126 127 128 129 130 131 132 133 134


SVC_OBJS =      \
		$(LIB_OBJS) \
		$(OBJDIR)/ClassFactory.o  \
        $(OBJDIR)/main.o
LIB_OBJS = \
        $(OBJDIR)/$(PACKAGE_NAME).o \
        $(OBJDIR)/$(PACKAGE_NAME)Class.o \
        $(OBJDIR)/$(PACKAGE_NAME)StateMachine.o \
135
        $(ADDITIONAL_OBJS)
Holger Witsch's avatar
Holger Witsch committed
136

137
SVC_INHERITANCE_OBJ =
Holger Witsch's avatar
Holger Witsch committed
138

139 140 141
#------------ Object files for additional files ------------
ADDITIONAL_OBJS = \
		$(OBJDIR)/FpgaAcquisitionThread.o \
142 143
		$(OBJDIR)/Numbat_Functions.o \
		$(OBJDIR)/sps.o
144

Holger Witsch's avatar
Holger Witsch committed
145 146 147 148
#=============================================================================
#	include common targets
#
include $(MAKE_ENV)/common_target.opt
149
# on debian7 this is possible. target.opt excludes it.
150
#CXX11 = -std=c++11
Holger Witsch's avatar
Holger Witsch committed
151

152
$(OBJDIR)/FpgaAcquisitionThread.o:  FpgaAcquisitionThread.cpp $(SVC_INCL)
153
	$(CXX) $(CXXFLAGS) -c $< -o $@
154
$(OBJDIR)/Numbat_Functions.o:  Numbat_Functions.c $(SVC_INCL)
155 156 157 158 159 160
	$(CXX) $(CXXFLAGS) -c $< -o $@
$(OBJDIR)/sps.o:  $(SPS_SRC)/sps.c $(SPS_INC)/spec_shm.h
	$(CC) $(CXXFLAGS) -c $< -o $@

#bin/$(BIN_DIR)/test_sps:
test_sps: $(OBJDIR)/sps.o test_sps.cpp
161 162
	$(CXX) -g -D_DEBUG $(CXXFLAGS) test_sps.cpp $< -o test_sps
	
163
read_spec_sps: $(OBJDIR)/sps.o read_spec_sps.cpp
164
	$(CXX) -g -D_DEBUG $(CXXFLAGS) read_spec_sps.cpp $< -o read_spec_sps