# MICO version. Modify to reflect your installation's version number. MICO_VERSION = 2.3.3 # target directory for general object files an executables. TARGET_DIR = mico # directory to place IDL-generated files in. IDL_DIR = MICO_generated # files auto-generated by IDL compiler IDL_FILES = $(IDL_DIR)/HelloWorld.h $(IDL_DIR)/HelloWorld.cc .PRECIOUS: $(IDL_FILES) # Compiler/Linker/IDL Compiler CXX = g++ LD = g++ IDL = idl # compiler/linker/idl compiler flags CXXFLAGS = -g -D__MICO__ -I$(IDL_DIR) LDFLAGS = -g -lmico$(MICO_VERSION) -ldl IDLFLAGS = --poa --no-boa # --no-exceptions # files removal RM = /bin/rm -f # directory creation/removal MKDIR = /bin/mkdir RMDIR = /bin/rmdir # programs' object files SERVER_OBJS = $(IDL_DIR)/HelloWorld.o \ $(TARGET_DIR)/hello-world-s.o $(TARGET_DIR)/HelloWorldImpl.o CLIENT_OBJS = $(IDL_DIR)/HelloWorld.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)/%.cc: %.idl (cd $(IDL_DIR)/ && $(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)