################################################################################
# Makefile settings for TMS System
################################################################################
#
# The main version
PROJECT = TMS
VERSION = 1.3.0
DEST_DIR = /dist/tms
PREFIX = /usr/tms
#RPM_DIR = /usr/src/redhat
#RPM_DIR = $(HOME)/rpmbuild
RPM_DIR = /scratch/rpms
SYSETCDIR = $(DEST_DIR)/etc
SYSDATADIR = $(DEST_DIR)/data
BINDIR = $(DEST_DIR)/$(PREFIX)/bin
INCDIR = $(DEST_DIR)/$(PREFIX)/include
LIBDIR = $(DEST_DIR)/$(PREFIX)/lib
DOCDIR = $(DEST_DIR)/$(PREFIX)/doc
DESKTOPDIR = $(DEST_DIR)/$(PREFIX)/share/applications
DESKTOPDIRDIR = $(DEST_DIR)/$(PREFIX)/share/desktop-directories
ICONSDIR = $(DEST_DIR)/$(PREFIX)/share/icons
CONFDIR = $(DEST_DIR)/$(PREFIX)/config
STATETABLEDIR = $(DEST_DIR)/$(PREFIX)/stateTables
FPGADIR = $(DEST_DIR)/$(PREFIX)/fpga
# Build Settings
INCDIRS = -I${INCDIR} -I${INCDIR}/Beam
LIBDIRS = -L${LIBDIR}
COPTIONS = -pipe -march=pentium -Wall -Wno-parentheses -Wreturn-type -Wno-conversion
DEBUGFLAGS = -O2
CXXFLAGS = $(COPTIONS) $(DEBUGFLAGS) -I. $(INCDIRS) -DVERSION=\"$(VERSION)\"
CXXFLAGS += -D_GNU_SOURCE
CXXFLAGS += -Wno-deprecated
CFLAGS = $(CXXFLAGS)
CXX = g++
CC = g++
LDFLAGS = $(LIBDIRS) $(DEBUGFLAGS)
LDLIBS = -lBeam -lpthread
DFLAGS = -Y -I. $(INCDIRS)
# QT Version
#QTDIR = $(shell ls -d /usr/lib/qt-* | tail -1)
.SUFFIXES: .spec
%.spec: Makefile.config
@(if ! grep "^Version:.*${VERSION}" $@; then\
sed -e "s/^Version:.*/Version:\t${VERSION}/" $@ > $@.tmp;\
mv $@.tmp $@; fi) 2>&1 > /dev/null