# target directory for general object files an executables. TARGET_DIR = tao # directory to place IDL-generated files in. IDL_DIR = TAO_generated # files auto-generated by IDL compiler IDL_FILES = $(IDL_DIR)/HelloWorldC.h $(IDL_DIR)/HelloWorldC.cc \ $(IDL_DIR)/HelloWorldS.h $(IDL_DIR)/HelloWorldS.cc .PRECIOUS: $(IDL_FILES) # Compiler/Linker/IDL Compiler CXX = g++ LD = g++ IDL = ${TAO_ROOT}/TAO_IDL/tao_idl # compiler/linker/idl compiler flags CXXFLAGS = -g -D__TAO__ \ -I$(IDL_DIR) -I$(TAO_ROOT) -I$(ACE_ROOT) LDFLAGS = -g -L$(ACE_ROOT)/ace -lTAO -lACE -ldl IDLFLAGS = -Ge 0 -cs C.cc -ss S.cc -sT S_T.cc -o $(IDL_DIR) # files removal RM = /bin/rm -f # directory creation/removal MKDIR = /bin/mkdir RMDIR = /bin/rmdir # programs' object files SERVER_OBJS = $(IDL_DIR)/HelloWorldC.o $(IDL_DIR)/HelloWorldS.o \ $(TARGET_DIR)/hello-world-s.o $(TARGET_DIR)/HelloWorldImpl.o CLIENT_OBJS = $(IDL_DIR)/HelloWorldC.o $(IDL_DIR)/HelloWorldS.o \ $(TARGET_DIR)/hello-world-c.o HEADERS = # # programs' executables SERVER = $(TARGET_DIR)/hello-world-s CLIENT = $(TARGET_DIR)/hello-world-c # top-level rule all: $(SERVER) $(CLIENT) $(SERVER): $(TARGET_DIR) $(IDL_DIR) $(SERVER_OBJS) $(LD) $(LDFLAGS) $(SERVER_OBJS) -o $(SERVER) $(CLIENT): $(TARGET_DIR) $(IDL_DIR) $(CLIENT_OBJS) $(LD) $(LDFLAGS) $(CLIENT_OBJS) -o $(CLIENT) # compile C source files into object files. $(TARGET_DIR)/%.o: %.cc $(CXX) $(CXXFLAGS) -c $*.cc -o $@ $(IDL_DIR)/%.o: $(IDL_DIR)/%.cc $(CXX) $(CXXFLAGS) -c $< -o $@ $(IDL_DIR)/%S.cc $(IDL_DIR)/%C.cc: %.idl $(IDL) $(IDLFLAGS) $*.idl #$(IDL_DIR)/%.h: %.idl # (cd $(IDL_DIR)/ && $(IDL) $(IDLFLAGS) ../$*.idl) $(IDL_DIR): @test -d $(IDL_DIR) || $(MKDIR) $(IDL_DIR) $(TARGET_DIR): @test -d $(TARGET_DIR) || $(MKDIR) $(TARGET_DIR) # clean everything clean: $(RM) -r $(TARGET_DIR) $(IDL_DIR)