#
#  Makefile for OMNET++VideoInterface
#
#  ** This file was automatically generated by the command:
#  opp_makemake -f
#

# Name of target to be created (-o option)
TARGET = OMNET++VideoInterface

# User interface (uncomment one) (-u option)
# USERIF_LIBS=$(CMDENV_LIBS)
USERIF_LIBS=$(TKENV_LIBS)

# uncomment 1 of the 3 lines to support either serial or parallel operation
KERNEL_LIBS=$(STD_KERNEL_LIBS)
# KERNEL_LIBS=$(PVM_KERNEL_LIBS)
# KERNEL_LIBS=$(MPI_KERNEL_LIBS)

# .ned or .h include paths with -I
INCLUDE_PATH=

# misc additional object and library files to link
EXRA_OBJS=

# object files in subdirectories
SUBDIR_OBJS=

# Additional libraries (-L option -l option)
LIBS=

#------------------------------------------------------------------------------

NEDC=/home/luca/omnetpp-2.2/src/nedc/nedcwrapper.sh
CXX=g++
CC=gcc
AR=ar cr
SHLIB_LD=g++ -shared -fPIC
MAKEDEPEND=opp_makedep -Y --objdirtree

CFLAGS=-O3 -DNDEBUG=1  -fPIC
NEDCFLAGS=-Wno-unused
LDFLAGS=
EXE_SUFFIX=

OMNETPP_INCL_DIR=/home/luca/omnetpp-2.2/include
OMNETPP_LIB_DIR=/home/luca/omnetpp-2.2/lib

TK_LIBS= -ltk -ltcl -L/usr/X11R6/lib -lX11 
MPI_LIBS=
PVM_LIBS=
SYS_LIBS=-lstdc++ -ldl -lm 
SYS_LIBS_PURE=-ldl -lsocket -lnsl -lm $(shell $(CXX) -print-file-name=libstdc++.a)

# User interface libs
CMDENV_LIBS=-lenvir -lcmdenv
TKENV_LIBS=-lenvir -ltkenv $(TK_LIBS)

# Simulation kernel
STD_KERNEL_LIBS=-lsim_std
MPI_KERNEL_LIBS=-lsim_mpi $(MPI_LIBS)
PVM_KERNEL_LIBS=-lsim_pvm $(PVM_LIBS)

# Simulation kernel and user interface libraries
OMNETPP_LIBS=-L$(OMNETPP_LIB_DIR) $(USERIF_LIBS) $(KERNEL_LIBS) $(SYS_LIBS)

COPTS=$(CFLAGS) $(INCLUDE_PATH) -I$(OMNETPP_INCL_DIR)
NEDCOPTS=$(CFLAGS) $(NEDCFLAGS) $(INCLUDE_PATH) -I$(OMNETPP_INCL_DIR)

#------------------------------------------------------------------------------

# Object files from this directory to link
OBJS= media_n.o mediapacket_n.o channel.o mod_application.o

$(TARGET): $(OBJS) $(EXRA_OBJS) Makefile 
	$(CXX) $(LDFLAGS) $(OBJS) $(EXRA_OBJS) $(SUBDIR_OBJS) $(LIBS) $(OMNETPP_LIBS) -o $(TARGET)

purify: $(OBJS) $(EXRA_OBJS)   Makefile
	purify $(CXX) $(LDFLAGS) $(OBJS) $(EXRA_OBJS) $(SUBDIR_OBJS) $(LIBS) -L$(OMNETPP_LIB_DIR) $(KERNEL_LIBS) $(USERIF_LIBS) $(SYS_LIBS_PURE) -o $(TARGET).pure

media_n.o: media_n.cc
	$(CXX) -c $(NEDCOPTS) media_n.cc

media_n.cc: media.ned
	$(NEDC) $(INCLUDE_PATH) media.ned

mediapacket_n.o: mediapacket_n.cc
	$(CXX) -c $(NEDCOPTS) mediapacket_n.cc

mediapacket_n.cc: mediapacket.ned
	$(NEDC) $(INCLUDE_PATH) mediapacket.ned

channel.o: channel.cc
	$(CXX) -c $(COPTS) channel.cc

mod_application.o: mod_application.cc
	$(CXX) -c $(COPTS) mod_application.cc

clean:
	rm -f *.o *_n.cc *_n.h $(TARGET)$(EXE_SUFFIX)
	rm -f *.vec *.sca

depend:
	$(MAKEDEPEND) $(INCLUDE_PATH) -- *.cc
	# $(MAKEDEPEND) $(INCLUDE_PATH) -fMakefile.in -- *.cc

re-makemake:
	opp_makemake -f    #recreate Makefile

re-makemake-m:
	opp_makemake -f -m    #recreate Makefile.in

# DO NOT DELETE THIS LINE -- make depend depends on it.

