]> mj.ucw.cz Git - libucw.git/blobdiff - build/Makebottom
Daemon: Preliminary documentation
[libucw.git] / build / Makebottom
index 35229a6d31be75c178e54a2933b4eea629f101cb..e2c840270933077bbf012b1a6ac67a5a99c64755 100644 (file)
@@ -42,7 +42,7 @@ force:
 
 # Rules for configuration files
 
 
 # Rules for configuration files
 
-run/$(CONFIG_DIR)/%: $(s)/$(CONFIG_DIR)/% $(o)/config.mk $(BUILDSYS)/genconf
+run/$(CONFIG_DIR)/%: $(s)/$(CONFIG_SRC_DIR)/% $(o)/config.mk $(BUILDSYS)/genconf
        $(M)CF $<
        $(Q)$(BUILDSYS)/genconf $< $@ $(o)/config.mk
 
        $(M)CF $<
        $(Q)$(BUILDSYS)/genconf $< $@ $(o)/config.mk
 
@@ -66,6 +66,14 @@ endif
        $(Q)$(CC) $(LSHARED) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(BUILDSYS)/lib-flags $^) $(LIBS)
        $(Q)$(call symlink-alias,$@,run/$(SO_RUNDIR),$(*F)$(SONAME_INFIX).so$(SONAME_SUFFIX))
 
        $(Q)$(CC) $(LSHARED) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(BUILDSYS)/lib-flags $^) $(LIBS)
        $(Q)$(call symlink-alias,$@,run/$(SO_RUNDIR),$(*F)$(SONAME_INFIX).so$(SONAME_SUFFIX))
 
+# On Darwin, gcc expects shared libraries in *.dylib instead of *.so.
+# Surprisingly, when a program is run, it suffices to have *.so files.
+# We don't want to mess up the whole build system with configurable
+# suffices and we also don't want to incur an overhead on Linux, so we
+# just create symbolic links on Darwin, if requested.
+%.dylib: %.so
+       cd $(dir $<) && ln -fs $(notdir $<) $(notdir $@)
+
 $(o)/%.pc: $(s)/%.pc $(o)/%.$(LS)
        $(M)PC $<
        $(Q)DEPS="$(shell $(BUILDSYS)/lib-deps $^)" LIBDIR=$(@D) $(BUILDSYS)/genconf $< $@ $(o)/config.mk
 $(o)/%.pc: $(s)/%.pc $(o)/%.$(LS)
        $(M)PC $<
        $(Q)DEPS="$(shell $(BUILDSYS)/lib-deps $^)" LIBDIR=$(@D) $(BUILDSYS)/genconf $< $@ $(o)/config.mk