# Make rules that are used in all TOVE modules. If you need to override
# some of these settings, do it in your module makefile AFTER you have
# included this file. See ovops/Makefile and pf/Makefile for examples.
#
# Author: Juhana Räsänen


# *** START OF LINUX-SPECIFIC SECTION ***
#
# Linux specific definitions. Uncomment these for Linux and comment out
# all definitions for other systems (if present).

CC = g++
IDL = idl 
MAKE = make

#DEFS = -DLINUX $(FSR_DEFS) -DSNACC_DEEP_COPY -D__STRICT_ANSI__ -DNO_EVENT -D__SSCOP_TESTING__
DEFS = -DLINUX $(FSR_DEFS) -DSNACC_DEEP_COPY -D__STRICT_ANSI__ -DNO_EVENT 
#DEFS = -DLINUX $(FSR_DEFS) -DSNACC_DEEP_COPY -DNON_STD_STL -DNO_EVENT -DOLD_ATM_VERSION

# Normal g++ CCFLAGS with debugging information
CCFLAGS = $(DEFS) -g -Wall -pedantic -frtti
#CCFLAGS = $(DEFS) -g -Wall -pedantic -frtti -fhandle-exceptions

# g++ CCFLAGS with gprof profiler information flag (-pg). Uncomment
# the next CCFLAGS line to use profiler and comment out above CCFLAGS
# definition.
#CCFLAGS = $(DEFS) -g -Wall -pedantic -frtti -pg
#
# *** END OF LINUX-SPECIFIC SECTION ***

LOCAL = /usr/local/lib
ORBLIB = $(LOCAL)/libOB.a $(LOCAL)/libJTC.a /usr/lib/libpthread.a
#ORBLIB = $(LOCAL)/libOB.a
NAMELIB = $(LOCAL)/libCosNaming.a
EVENTLIB = $(LOCAL)/libCosEvent.a
PROPERTYLIB = $(LOCAL)/libCosProperty.a
ASN1_LIB = $(LOCAL)/libasn1c++.a

# Include dirs. TOVESRC environment variable must be set to point to the
# root of your tove software tree.
INC_DIRS = -I. -I$(TOVESRC) -I/usr/local/include/snacc/c++ -I/usr/local/include -I/usr/local/src/OB-3.0.1/naming/idl

# Default suffix for C++ source files.
.SUFFIXES: .cpp .C


# Default rule for making an skeleton and stub files from IDL source file.
.idl.h:
	$(IDL) $<

# Default rule for making an object file from source file.
.cpp.o:
	$(CC) -c $(CCFLAGS) $(INC_DIRS) $<

# Default rule for making an object file from source file.
.C.o:
	$(CC) -c $(CCFLAGS) $(INC_DIRS) $<


# Default 'all' rule for modules. Both TARGET and ARTARGET are specified
# so that this same rule would work for both individual rules and top
# level executable. One or the other will be empty, so it doesn't matter.
all: $(TARGET) $(ARTARGET)


# Default rule to make an archive target. If your module has other kind
# of targets, you must specify them in your own makefile.
$(ARTARGET): $(OBJS)
	$(AR) rcs $(ARTARGET) $(OBJS)
	ranlib $(ARTARGET)


# Default rule for making dependencies.
dep:
	makedepend -Y $(INC_DIRS) $(DEFS) *.cpp 2> /dev/null


# Default rule for cleaning up. Again, both TARGET and ARTARGET are here.
clean:
	rm -rf *~ *.o core $(TARGET) $(ARTARGET)
