Autotools-Bibliotheks- und Objektdateiausgabesteuerung
Mein Ziel ist es, alle Objektdateien in einem .objs-Verzeichnis anstelle des Stammverzeichnisses des Makefile zu erstellen und die Binärdateien (und Bibliotheken) in das Projekt zu kopierenBehälter/ Verzeichnis. Ich konnte jedoch keine Ressourcen finden, die erklären, wie dies zu tun ist. Wie würde ich das machen?
Hier ist meine configure.ac undsrc / Makefile.am - Ich habe ähnliche Makefile.am-Dateien für zwei gemeinsam genutzte Bibliotheken, auf die verwiesen wird. Sie kompilieren und kopieren sie in dieBehälter/ Verzeichnis arbeiten, wie sie sollten. Ich versuche nur, diesen Prozess zu automatisieren.
configure.ac
<code>AC_PREREQ([2.63]) AC_INIT([gtkworkbook], [0.12], [[email protected]]) AC_CONFIG_SRCDIR([gtkworkbook/cell.c]) AM_INIT_AUTOMAKE([gtkworkbook], [0.12]) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_RANLIB AC_PROG_LIBTOOL AC_PROG_CC_C_O AC_CHECK_LIB([pthread], [pthread_mutex_init], [], [ echo "pthread library is missing. pthread is required for this program" exit -1]) # Checks for header files. AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_INLINE AC_TYPE_SIZE_T # Checks for library functions. AC_CHECK_FUNCS([gethostbyname memset socket]) AC_OUTPUT([Makefile csv/Makefile gtkworkbook/Makefile src/Makefile]) </code>
src / Makefile.am
<code>AUTOMAKE_OPTIONS= foreign C_FLAGS= -I/usr/local/include -I/usr/include -I/usr/local/include/gtkextra-2.0 -I$(top_srcdir)/include `pkg-config gtk+-2.0 glib-2.0 --cflags` L_FLAGS= -L/usr/local/lib -L/usr/lib -L$(top_srcdir)/lib `pkg-config gtk+-2.0 glib-2.0 --libs` -lgtkextra-x11-2.0 bin_PROGRAMS= gtkworkbook gtkworkbook_SOURCES= application.c config.c main.c parse.c plugin.c gtkworkbook_CFLAGS= -Wall -lgthread-2.0 -std=c99 $(C_FLAGS) gtkworkbook_LFLAGS= -ldl $(L_FLAGS) gtkworkbook_LDFLAGS= $(L_FLAGS) gtkworkbook_LDADD= ../gtkworkbook/libgtkworkbook.la ../csv/libcsv.la lib_LTLIBRARIES= realtime.la realtime_la_SOURCES= realtime/CsvParser.cpp realtime/Network.cpp realtime/Packet.cpp realtime/plugin_main.cpp \ realtime/thread_main.cpp realtime/concurrent/Mutex.cpp realtime/concurrent/Semaphore.cpp \ realtime/concurrent/Thread.cpp realtime/concurrent/ThreadGroup.cpp realtime/concurrent/ThreadPool.cpp \ realtime/proactor/Dispatcher.cpp realtime/proactor/Event.cpp realtime/proactor/Proactor.cpp \ realtime/proactor/InputDispatcher.cpp realtime/proactor/Worker.cpp realtime/network/Tcp.cpp realtime_la_CPPFLAGS= -Wall -Wno-write-strings $(C_FLAGS) realtime_la_LFLAGS= -lgtkworkbook -lcsv $(L_FLAGS) realtime_la_LDFLAGS= -module -export-dynamic realtime_la_LIBADD= ../gtkworkbook/libgtkworkbook.la ../csv/libcsv.la </code>
Meine Frage ist also, wie man die Ausgabeverzeichnisse für die Kompilierungsergebnisse jedes Makefiles angibt (ich möchte, dass sie in dieses kopiert werdenBehälter/und für die Objektdateien in.obj von jedem Projekt statt im Stammverzeichnis des Makefiles.
Vielen Dank für die bisherige Hilfe. Diese Website war eine großartige Ressource, und ich habe viel aus den bereits bereitgestellten Links gelernt.