Mein Ziel ist es, alle Objektdateien in einem .objs Verzeichnis gebaut zu haben, statt die Wurzel des Makefiles und die Binärdateien (und Bibliotheken) in das Projekt kopiert ist/ Verzeichnis . Aber ich konnte keine Ressourcen finden, um zu erklären, wie das geht. Wie würde ich das machen?Autotools Bibliothek und Objektdatei Ausgabesteuerung
Hier ist meine configure.ac und src/Makefile.am - Ich habe ähnliche Makefile.am Dateien für zwei gemeinsame Bibliotheken, die referenziert werden. Sie kompilieren und nach dem Kopieren in das Verzeichnis bin/ arbeiten so, wie sie sollten. Ich möchte nur diesen Prozess automatisieren.
configure.ac
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])
src/Makefile.am
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
So ist meine Frage, wie die Ausgabeverzeichnisse für die Kompilierung Ergebnisse jedes Makefile zu spezifizieren (I wünsche, dass sie in bin/ kopiert werden, und für die Objektdateien in .obj von jedem Pro sein ject statt in der Wurzel des Makefiles.
Danke für die Hilfe bis jetzt .. diese Website war eine großartige Ressource, und ich habe viel gelernt von den Links bereits zur Verfügung gestellt.
Das kann nicht über die Befehlszeile configure überschrieben werden? –