diff --git a/Makefile.am b/Makefile.am index 44787f9..7019290 100644 --- a/Makefile.am +++ b/Makefile.am @@ -147,6 +147,31 @@ endif EXTRA_DIST += src/genversion.sh GITHEAD:=$(shell $(emptyvariable)"$(srcdir)/src/genversion.sh" "$(srcdir)/src/shl_githead.c") +# +# Binary File Compiler +# This target gets as input a binary file *.bin and produces an ELF/etc. output +# object file *.bin.o and the corresponding libtool file *.bin.lo. +# Note that we fake the libtool object files as there is no way to make libtool +# create it. The comments in the .lo file are mandatory so don't remove them! +# + +CLEANFILES += src/*.bin.lo src/*.bin.o + +src/%.bin.lo: src/%.bin + $(AM_V_GEN)$(LD) -r -o "src/$*.bin.o" -z noexecstack --format=binary "$<" + $(AM_V_at)echo "# $@ - a libtool object file" >"$@" + $(AM_V_at)echo "# Generated by $(shell $(LIBTOOL) --version | head -n 1)" >>"$@" + $(AM_V_at)echo "#" >>"$@" + $(AM_V_at)echo "# Please DO NOT delete this file!" >>"$@" + $(AM_V_at)echo "# It is necessary for linking the library." >>"$@" + $(AM_V_at)echo >>"$@" + $(AM_V_at)echo "# Name of the PIC object." >>"$@" + $(AM_V_at)echo "pic_object='$*.bin.o'" >>"$@" + $(AM_V_at)echo >>"$@" + $(AM_V_at)echo "# Name of the non-PIC object" >>"$@" + $(AM_V_at)echo "non_pic_object='$*.bin.o'" >>"$@" + $(AM_V_at)echo >>"$@" + # # SHL - Static Helper Library # The SHL subsystem contains several small code pieces used all over kmscon and @@ -430,6 +455,7 @@ src/static_shaders.c: $(SHADERS) genshader$(EXEEXT) UNIFONT = $(top_srcdir)/src/font_unifont_data.hex UNIFONT_BIN = src/font_unifont_data.bin +UNIFONT_LT = src/font_unifont_data.bin.lo EXTRA_DIST += $(UNIFONT) CLEANFILES += $(UNIFONT_BIN) @@ -451,14 +477,13 @@ mod_unifont_la_SOURCES = \ src/kmscon_module_interface.h \ src/font_unifont.c \ src/kmscon_mod_unifont.c -EXTRA_mod_unifont_la_DEPENDENCIES = $(UNIFONT_BIN) -mod_unifont_la_LIBADD = libshl.la +mod_unifont_la_LIBADD = \ + $(UNIFONT_LT) \ + libshl.la mod_unifont_la_LDFLAGS = \ $(AM_LDFLAGS) \ -module \ - -avoid-version \ - -Wl,-z,noexecstack \ - -Wl,--format=binary -Wl,$(UNIFONT_BIN) -Wl,--format=default + -avoid-version if BUILD_ENABLE_FONT_FREETYPE2 module_LTLIBRARIES += mod-freetype2.la