# # Definitions to be customized by 'configure' # CONFIGFILE = ../../Makefile.inc include $(CONFIGFILE) # # Local definitions # LIBNAME=$(LIB_PREFIX)opplayout$D TARGET_LIB_FILES=$(OMNETPP_LIB_DIR)/$(LIBNAME)$(LIB_SUFFIX) # On Windows, the targets are different (DLLs go into the bin dir and separate export libs are created) ifeq ($(PLATFORM),win32.x86_64) ifeq ($(SHARED_LIBS),yes) TARGET_LIB_FILES=$(OMNETPP_BIN_DIR)/$(LIBNAME)$(DLL_LIB_SUFFIX) $(OMNETPP_LIB_DIR)/$(LIBNAME)$(A_LIB_SUFFIX) ifeq ($(TOOLCHAIN_NAME),clangc2) ifeq ($(MODE),debug) TARGET_LIB_FILES+=$(OMNETPP_BIN_DIR)/$(LIBNAME).pdb endif endif endif endif O=$(OMNETPP_OUT_DIR)/$(TOOLCHAIN_NAME)-$(MODE)/src/layout INCL_FLAGS= -I"$(OMNETPP_INCL_DIR)" -I"$(OMNETPP_SRC_DIR)" COPTS=$(CFLAGS) $(INCL_FLAGS) IMPLIBS= -loppcommon$D OBJS= $O/geometry.o $O/graphcomponent.o $O/heapembedding.o $O/startreeembedding.o \ $O/forcedirectedparametersbase.o $O/forcedirectedparameters.o $O/forcedirectedembedding.o \ $O/graphlayouter.o $O/basicspringembedderlayout.o $O/forcedirectedgraphlayouter.o # macro is used in $(EXPORT_DEFINES) with clang/c2 when building a shared lib EXPORT_MACRO = -DLAYOUT_EXPORT .PHONY: all clean .SECONDARY: $(OBJS) $O/$(LIBNAME)$(LIB_SUFFIX) # # Automatic rules # .SUFFIXES : .cc $O/%.o: %.cc $(CONFIGFILE) @mkdir -p $O $(qecho) "$<" $(Q)$(CXX) -c $(CXXFLAGS) $(COPTS) $(EXPORT_DEFINES) $(IMPORT_DEFINES) -o $@ $< # # Targets # all : $(TARGET_LIB_FILES) ifeq ($(SHARED_LIBS),yes) # dynamically linked library (on all platforms except Windows) $O/%$(SO_LIB_SUFFIX) : $(OBJS) @mkdir -p $O @echo Creating shared library: $@ $(Q)$(SHLIB_LD) $(LDFLAGS) -o $O/$(LIBNAME)$(SO_LIB_SUFFIX) $(OBJS) $(IMPLIBS) # dynamically linked library + import lib (on Windows) $O/%$(DLL_LIB_SUFFIX) $O/%$(A_LIB_SUFFIX): $(OBJS) @mkdir -p $O @echo Creating DLL and import library: $@ $(Q)$(SHLIB_LD) $(LDFLAGS) -o $O/$(LIBNAME)$(DLL_LIB_SUFFIX) $(OBJS) $(IMPLIBS) $(LDFLAG_IMPLIB)$O/$(LIBNAME)$(A_LIB_SUFFIX) else # statically linked library (on all platforms) $O/%$(A_LIB_SUFFIX) : $(OBJS) @mkdir -p $O @echo Creating static library: $@ $(Q)$(AR) $(ARFLAG_OUT)$O/$(LIBNAME)$(A_LIB_SUFFIX) $(OBJS) $(Q)$(RANLIB) $O/$(LIBNAME)$(A_LIB_SUFFIX) endif # copy files to the bin and lib directories from the out directory $(OMNETPP_BIN_DIR)/% $(OMNETPP_LIB_DIR)/%: $O/% $(CONFIGFILE) @mkdir -p $(OMNETPP_BIN_DIR) $(OMNETPP_LIB_DIR) @echo Copying to: $@ $(Q)cp $< $@ $(Q)$(SHLIB_POSTPROCESS) $@ $O/$(LIBNAME).pdb: $O/$(LIBNAME)$(DLL_LIB_SUFFIX) clean: $(qecho) Cleaning layout $(Q)rm -rf $O $(GENERATED_SOURCES) $(TARGET_LIB_FILES) -include $(OBJS:%.o=%.d)