mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 07:16:17 +02:00
Consistent naming
This commit is contained in:
parent
c1f3a1a89b
commit
07c87a8e9e
1 changed files with 10 additions and 10 deletions
20
Makefile.lib
20
Makefile.lib
|
@ -54,7 +54,7 @@ define LIBS_template =
|
||||||
_d := $$(strip $$($(1)_DIR))
|
_d := $$(strip $$($(1)_DIR))
|
||||||
_srcs := $$(foreach src, $$($(1)_SOURCES), $$(_d)/$$(src))
|
_srcs := $$(foreach src, $$($(1)_SOURCES), $$(_d)/$$(src))
|
||||||
$(1)_OBJS := $$(addsuffix .o, $$(basename $$(_srcs)))
|
$(1)_OBJS := $$(addsuffix .o, $$(basename $$(_srcs)))
|
||||||
_libs := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_NAME))
|
_libs := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_PATH))
|
||||||
|
|
||||||
$(1)_LDFLAGS_USE :=
|
$(1)_LDFLAGS_USE :=
|
||||||
$(1)_LDFLAGS_USE_INSTALLED :=
|
$(1)_LDFLAGS_USE_INSTALLED :=
|
||||||
|
@ -65,8 +65,9 @@ define LIBS_template =
|
||||||
$(1)_LDFLAGS += -z defs
|
$(1)_LDFLAGS += -z defs
|
||||||
endif
|
endif
|
||||||
|
|
||||||
_lib := $$(_d)/$(1).so
|
$(1)_PATH := $$(_d)/$(1).so
|
||||||
$$(_lib): $$($(1)_OBJS) $$(_libs)
|
|
||||||
|
$$($(1)_PATH): $$($(1)_OBJS) $$(_libs)
|
||||||
$(QUIET) $(CXX) -o $$@ -shared $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$($(1)_LDFLAGS_PROPAGATED) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE))
|
$(QUIET) $(CXX) -o $$@ -shared $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$($(1)_LDFLAGS_PROPAGATED) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE))
|
||||||
|
|
||||||
$(1)_LDFLAGS_USE += -L$$(_d) -Wl,-rpath,$$(abspath $$(_d)) -l$$(patsubst lib%,%,$$(strip $(1)))
|
$(1)_LDFLAGS_USE += -L$$(_d) -Wl,-rpath,$$(abspath $$(_d)) -l$$(patsubst lib%,%,$$(strip $(1)))
|
||||||
|
@ -85,11 +86,12 @@ define LIBS_template =
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
_lib := $$(_d)/$(1).a
|
$(1)_PATH := $$(_d)/$(1).a
|
||||||
$$(_lib): $$($(1)_OBJS)
|
|
||||||
|
$$($(1)_PATH): $$($(1)_OBJS)
|
||||||
$(QUIET) ar crs $$@ $$?
|
$(QUIET) ar crs $$@ $$?
|
||||||
|
|
||||||
$(1)_LDFLAGS_USE += $$(_lib) $$($(1)_LDFLAGS)
|
$(1)_LDFLAGS_USE += $$($(1)_PATH) $$($(1)_LDFLAGS)
|
||||||
|
|
||||||
$(1)_INSTALL_PATH := $$(pkglibdir)/$(1).a
|
$(1)_INSTALL_PATH := $$(pkglibdir)/$(1).a
|
||||||
|
|
||||||
|
@ -98,14 +100,12 @@ define LIBS_template =
|
||||||
$(1)_LDFLAGS_USE += $$($(1)_LDFLAGS_PROPAGATED)
|
$(1)_LDFLAGS_USE += $$($(1)_LDFLAGS_PROPAGATED)
|
||||||
$(1)_LDFLAGS_USE_INSTALLED += $$($(1)_LDFLAGS_PROPAGATED)
|
$(1)_LDFLAGS_USE_INSTALLED += $$($(1)_LDFLAGS_PROPAGATED)
|
||||||
|
|
||||||
$(1)_NAME := $$(_lib)
|
|
||||||
|
|
||||||
# Propagate CXXFLAGS to the individual object files.
|
# Propagate CXXFLAGS to the individual object files.
|
||||||
$$(foreach obj, $$($(1)_OBJS), $$(eval $$(obj)_CXXFLAGS=$$($(1)_CXXFLAGS)))
|
$$(foreach obj, $$($(1)_OBJS), $$(eval $$(obj)_CXXFLAGS=$$($(1)_CXXFLAGS)))
|
||||||
|
|
||||||
include $$(wildcard $$(_d)/*.dep)
|
include $$(wildcard $$(_d)/*.dep)
|
||||||
|
|
||||||
libs_list += $$(_lib)
|
libs_list += $$($(1)_PATH)
|
||||||
clean_list += $$(_d)/*.a $$(_d)/*.so $$(_d)/*.o $$(_d)/*.dep
|
clean_list += $$(_d)/*.a $$(_d)/*.so $$(_d)/*.o $$(_d)/*.dep
|
||||||
dist_files += $$(_srcs)
|
dist_files += $$(_srcs)
|
||||||
endef
|
endef
|
||||||
|
@ -120,7 +120,7 @@ define PROGRAMS_template =
|
||||||
_d := $$($(1)_DIR)
|
_d := $$($(1)_DIR)
|
||||||
_srcs := $$(foreach src, $$($(1)_SOURCES), $$(_d)/$$(src))
|
_srcs := $$(foreach src, $$($(1)_SOURCES), $$(_d)/$$(src))
|
||||||
$(1)_OBJS := $$(addsuffix .o, $$(basename $$(_srcs)))
|
$(1)_OBJS := $$(addsuffix .o, $$(basename $$(_srcs)))
|
||||||
_libs := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_NAME))
|
_libs := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_PATH))
|
||||||
$(1)_PATH := $$(_d)/$(1)
|
$(1)_PATH := $$(_d)/$(1)
|
||||||
|
|
||||||
$$($(1)_PATH): $$($(1)_OBJS) $$(_libs)
|
$$($(1)_PATH): $$($(1)_OBJS) $$(_libs)
|
||||||
|
|
Loading…
Reference in a new issue