From: Uwe Hermann Date: Sat, 8 Jan 2011 02:32:25 +0000 (+0100) Subject: Fix out-of-tree build. X-Git-Tag: libsigrok-0.1.0~474 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=340f6e7aeaf0c6cbbb27c5b535787bd09407994b;p=libsigrok.git Fix out-of-tree build. Use libtool "noinst" local helper libs and use one Makefile.am per subdir, which is the usual/preferred method. These helper libraries are purely local and will not be installed. This also fixes out-of-tree builds of sigrok, i.e. building in a directory other than the sigrok source directory, e.g. $ cd /home/user $ git clone ...sigrok $ cd sigrok $ ./autogen.sh $ mkdir /tmp/foo $ cd /tmp/foo $ /home/user/sigrok/configure $ make $ make install This will place all build results (.o files, .la files, etc) in the local build directory (/tmp/foo) instead of the source directory (/home/user/sigrok in this example). The installation directory is selected via the --prefix configure option (/usr/local per default). --- diff --git a/Makefile.am b/Makefile.am index 85dfe41c..ca35bb23 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,6 +20,8 @@ AM_CPPFLAGS = -I $(top_srcdir)/libsigrok \ -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"' +SUBDIRS = hardware input output + lib_LTLIBRARIES = libsigrok.la libsigrok_la_SOURCES = \ @@ -28,59 +30,13 @@ libsigrok_la_SOURCES = \ device.c \ session.c \ hwplugin.c \ - filter.c \ - hardware/common/ezusb.c \ - hardware/common/misc.c \ - hardware/common/serial.c \ - hardware/demo/demo.c \ - input/input_binary.c \ - input/input.c \ - output/output_binary.c \ - output/output_text.c \ - output/output_vcd.c \ - output/output_gnuplot.c \ - output/common.c \ - output/output.c - -if LA_ASIX_SIGMA -libsigrok_la_SOURCES += \ - hardware/asix-sigma/asix-sigma.c \ - hardware/asix-sigma/asix-sigma.h -else -EXTRA_DIST = \ - hardware/asix-sigma/asix-sigma.c \ - hardware/asix-sigma/asix-sigma.h -endif - -if LA_OLS -libsigrok_la_SOURCES += hardware/openbench-logic-sniffer/ols.c -else -EXTRA_DIST = hardware/openbench-logic-sniffer/ols.c -endif - -if LA_SALEAE_LOGIC -libsigrok_la_SOURCES += hardware/saleae-logic/saleae-logic.c -else -EXTRA_DIST = hardware/saleae-logic/saleae-logic.c -endif - -if LA_ZEROPLUS_LOGIC_CUBE -libsigrok_la_SOURCES += \ - hardware/zeroplus-logic-cube/analyzer.c \ - hardware/zeroplus-logic-cube/analyzer.h \ - hardware/zeroplus-logic-cube/gl_usb.c \ - hardware/zeroplus-logic-cube/gl_usb.h \ - hardware/zeroplus-logic-cube/zeroplus.c -else -EXTRA_DIST = \ - hardware/zeroplus-logic-cube/analyzer.c \ - hardware/zeroplus-logic-cube/analyzer.h \ - hardware/zeroplus-logic-cube/gl_usb.c \ - hardware/zeroplus-logic-cube/gl_usb.h \ - hardware/zeroplus-logic-cube/zeroplus.c -endif + filter.c -libsigrok_la_LIBADD = $(LIBOBJS) +libsigrok_la_LIBADD = \ + $(LIBOBJS) \ + hardware/libsigrokhardware.la \ + input/libsigrokinput.la \ + output/libsigrokoutput.la include_HEADERS = sigrok.h diff --git a/hardware/Makefile.am b/hardware/Makefile.am new file mode 100644 index 00000000..1f559ba0 --- /dev/null +++ b/hardware/Makefile.am @@ -0,0 +1,51 @@ +## +## This file is part of the sigrok project. +## +## Copyright (C) 2011 Uwe Hermann +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## + +SUBDIRS = \ + asix-sigma \ + common \ + demo \ + openbench-logic-sniffer \ + saleae-logic \ + zeroplus-logic-cube + +noinst_LTLIBRARIES = libsigrokhardware.la + +libsigrokhardware_la_SOURCES = + +libsigrokhardware_la_LIBADD = \ + common/libsigrokhwcommon.la \ + demo/libsigrokhwdemo.la + +if LA_ASIX_SIGMA +libsigrokhardware_la_LIBADD += asix-sigma/libsigrokhwasixsigma.la +endif + +if LA_OLS +libsigrokhardware_la_LIBADD += openbench-logic-sniffer/libsigrokhwols.la +endif + +if LA_SALEAE_LOGIC +libsigrokhardware_la_LIBADD += saleae-logic/libsigrokhwsaleaelogic.la +endif + +if LA_ZEROPLUS_LOGIC_CUBE +libsigrokhardware_la_LIBADD += zeroplus-logic-cube/libsigrokhwzeroplus.la +endif + diff --git a/hardware/asix-sigma/Makefile.am b/hardware/asix-sigma/Makefile.am new file mode 100644 index 00000000..0413a0db --- /dev/null +++ b/hardware/asix-sigma/Makefile.am @@ -0,0 +1,31 @@ +## +## This file is part of the sigrok project. +## +## Copyright (C) 2011 Uwe Hermann +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## + +AM_CPPFLAGS = -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"' + +# Local lib, this is NOT meant to be installed! +noinst_LTLIBRARIES = libsigrokhwasixsigma.la + +libsigrokhwasixsigma_la_SOURCES = \ + asix-sigma.c \ + asix-sigma.h + +libsigrokhwasixsigma_la_CFLAGS = \ + -I$(top_srcdir)/libsigrok + diff --git a/hardware/common/Makefile.am b/hardware/common/Makefile.am new file mode 100644 index 00000000..e8a708f3 --- /dev/null +++ b/hardware/common/Makefile.am @@ -0,0 +1,30 @@ +## +## This file is part of the sigrok project. +## +## Copyright (C) 2011 Uwe Hermann +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## + +# Local lib, this is NOT meant to be installed! +noinst_LTLIBRARIES = libsigrokhwcommon.la + +libsigrokhwcommon_la_SOURCES = \ + ezusb.c \ + misc.c \ + serial.c + +libsigrokhwcommon_la_CFLAGS = \ + -I$(top_srcdir)/libsigrok + diff --git a/hardware/demo/Makefile.am b/hardware/demo/Makefile.am new file mode 100644 index 00000000..28287baf --- /dev/null +++ b/hardware/demo/Makefile.am @@ -0,0 +1,28 @@ +## +## This file is part of the sigrok project. +## +## Copyright (C) 2011 Uwe Hermann +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## + +# Local lib, this is NOT meant to be installed! +noinst_LTLIBRARIES = libsigrokhwdemo.la + +libsigrokhwdemo_la_SOURCES = \ + demo.c + +libsigrokhwdemo_la_CFLAGS = \ + -I$(top_srcdir)/libsigrok + diff --git a/hardware/openbench-logic-sniffer/Makefile.am b/hardware/openbench-logic-sniffer/Makefile.am new file mode 100644 index 00000000..a4881f56 --- /dev/null +++ b/hardware/openbench-logic-sniffer/Makefile.am @@ -0,0 +1,28 @@ +## +## This file is part of the sigrok project. +## +## Copyright (C) 2011 Uwe Hermann +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## + +# Local lib, this is NOT meant to be installed! +noinst_LTLIBRARIES = libsigrokhwols.la + +libsigrokhwols_la_SOURCES = \ + ols.c + +libsigrokhwols_la_CFLAGS = \ + -I$(top_srcdir)/libsigrok + diff --git a/hardware/saleae-logic/Makefile.am b/hardware/saleae-logic/Makefile.am new file mode 100644 index 00000000..3e7fc724 --- /dev/null +++ b/hardware/saleae-logic/Makefile.am @@ -0,0 +1,30 @@ +## +## This file is part of the sigrok project. +## +## Copyright (C) 2011 Uwe Hermann +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## + +AM_CPPFLAGS = -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"' + +# Local lib, this is NOT meant to be installed! +noinst_LTLIBRARIES = libsigrokhwsaleaelogic.la + +libsigrokhwsaleaelogic_la_SOURCES = \ + saleae-logic.c + +libsigrokhwsaleaelogic_la_CFLAGS = \ + -I$(top_srcdir)/libsigrok + diff --git a/hardware/zeroplus-logic-cube/Makefile.am b/hardware/zeroplus-logic-cube/Makefile.am new file mode 100644 index 00000000..17f7c122 --- /dev/null +++ b/hardware/zeroplus-logic-cube/Makefile.am @@ -0,0 +1,32 @@ +## +## This file is part of the sigrok project. +## +## Copyright (C) 2011 Uwe Hermann +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## + +# Local lib, this is NOT meant to be installed! +noinst_LTLIBRARIES = libsigrokhwzeroplus.la + +libsigrokhwzeroplus_la_SOURCES = \ + analyzer.c \ + analyzer.h \ + gl_usb.c \ + gl_usb.h \ + zeroplus.c + +libsigrokhwzeroplus_la_CFLAGS = \ + -I$(top_srcdir)/libsigrok + diff --git a/input/Makefile.am b/input/Makefile.am new file mode 100644 index 00000000..8f58f0fe --- /dev/null +++ b/input/Makefile.am @@ -0,0 +1,29 @@ +## +## This file is part of the sigrok project. +## +## Copyright (C) 2011 Uwe Hermann +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## + +# Local lib, this is NOT meant to be installed! +noinst_LTLIBRARIES = libsigrokinput.la + +libsigrokinput_la_SOURCES = \ + input_binary.c \ + input.c + +libsigrokinput_la_CFLAGS = \ + -I$(top_srcdir)/libsigrok + diff --git a/output/Makefile.am b/output/Makefile.am new file mode 100644 index 00000000..7e18acfe --- /dev/null +++ b/output/Makefile.am @@ -0,0 +1,35 @@ +## +## This file is part of the sigrok project. +## +## Copyright (C) 2011 Uwe Hermann +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## + +AM_CPPFLAGS = -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"' + +# Local lib, this is NOT meant to be installed! +noinst_LTLIBRARIES = libsigrokoutput.la + +libsigrokoutput_la_SOURCES = \ + output_binary.c \ + output_text.c \ + output_vcd.c \ + output_gnuplot.c \ + common.c \ + output.c + +libsigrokoutput_la_CFLAGS = \ + -I$(top_srcdir)/libsigrok +