diff --git a/sys-utils/libcmt/Makefile b/sys-utils/libcmt/Makefile index e322fa4..b45a9c9 100644 --- a/sys-utils/libcmt/Makefile +++ b/sys-utils/libcmt/Makefile @@ -26,7 +26,7 @@ TARGET_PREFIX ?= $(PREFIX) TOOLCHAIN_PREFIX ?= riscv64-linux-gnu- TARGET_CC := $(TOOLCHAIN_PREFIX)gcc TARGET_AR := $(TOOLCHAIN_PREFIX)ar -COMMON_CFLAGS := -Wvla -O2 -g -Wall -pedantic -Wextra -Isrc \ +COMMON_CFLAGS := -Wvla -O2 -g -Wall -pedantic -Wextra -Iinclude \ -fno-strict-aliasing -fno-strict-overflow -fPIC TARGET_CFLAGS := $(COMMON_CFLAGS) -ftrivial-auto-var-init=zero -Wstrict-aliasing=3 CFLAGS := $(COMMON_CFLAGS) @@ -85,7 +85,7 @@ install: $(libcmt_LIB) $(libcmt_SO) build/ffi.h mkdir -p $(TARGET_DESTDIR)$(TARGET_PREFIX)/lib cp -f $(libcmt_LIB) $(libcmt_SO) $(TARGET_DESTDIR)$(TARGET_PREFIX)/lib mkdir -p $(TARGET_DESTDIR)$(TARGET_PREFIX)/include/libcmt/ - cp -f src/*.h $(TARGET_DESTDIR)$(TARGET_PREFIX)/include/libcmt/ + cp -f include/libcmt/*.h $(TARGET_DESTDIR)$(TARGET_PREFIX)/include/libcmt/ cp -f build/ffi.h $(TARGET_DESTDIR)$(TARGET_PREFIX)/include/libcmt/ mkdir -p $(TARGET_DESTDIR)$(TARGET_PREFIX)/lib/pkgconfig sed -e 's|@ARG_PREFIX@|$(TARGET_PREFIX)|g' src/libcmt.pc > $(TARGET_DESTDIR)$(TARGET_PREFIX)/lib/pkgconfig/libcmt.pc @@ -126,7 +126,7 @@ install-mock: $(mock_LIB) $(mock_SO) build/ffi.h mkdir -p $(DESTDIR)$(PREFIX)/lib cp -f $(mock_LIB) $(mock_SO) $(DESTDIR)$(PREFIX)/lib mkdir -p $(DESTDIR)$(PREFIX)/include/libcmt/ - cp -f src/*.h $(DESTDIR)$(PREFIX)/include/libcmt/ + cp -f include/libcmt/*.h $(DESTDIR)$(PREFIX)/include/libcmt/ cp -f build/ffi.h $(DESTDIR)$(PREFIX)/include/libcmt/ mkdir -p $(DESTDIR)$(PREFIX)/lib/pkgconfig sed -e 's|@ARG_PREFIX@|$(PREFIX)|g' src/libcmt_mock.pc > $(DESTDIR)$(PREFIX)/lib/pkgconfig/libcmt.pc @@ -183,7 +183,8 @@ $(tools_OBJDIR)/funsel: tools/funsel.c $(mock_LIB) tools: $(tools_BINS) -build/ffi.h: src/buf.h src/abi.h src/keccak.h src/merkle.h src/io.h src/rollup.h +HDRS := $(patsubst %,include/libcmt/%, buf.h abi.h keccak.h merkle.h io.h rollup.h) +build/ffi.h: $(HDRS) cat $^ | sh tools/prepare-ffi.sh > $@ #------------------------------------------------------------------------------- LINTER_IGNORE_SOURCES=src/io.c diff --git a/sys-utils/libcmt/src/abi.h b/sys-utils/libcmt/include/libcmt/abi.h similarity index 100% rename from sys-utils/libcmt/src/abi.h rename to sys-utils/libcmt/include/libcmt/abi.h diff --git a/sys-utils/libcmt/src/buf.h b/sys-utils/libcmt/include/libcmt/buf.h similarity index 100% rename from sys-utils/libcmt/src/buf.h rename to sys-utils/libcmt/include/libcmt/buf.h diff --git a/sys-utils/libcmt/src/io.h b/sys-utils/libcmt/include/libcmt/io.h similarity index 100% rename from sys-utils/libcmt/src/io.h rename to sys-utils/libcmt/include/libcmt/io.h diff --git a/sys-utils/libcmt/src/keccak.h b/sys-utils/libcmt/include/libcmt/keccak.h similarity index 100% rename from sys-utils/libcmt/src/keccak.h rename to sys-utils/libcmt/include/libcmt/keccak.h diff --git a/sys-utils/libcmt/src/merkle.h b/sys-utils/libcmt/include/libcmt/merkle.h similarity index 100% rename from sys-utils/libcmt/src/merkle.h rename to sys-utils/libcmt/include/libcmt/merkle.h diff --git a/sys-utils/libcmt/src/rollup.h b/sys-utils/libcmt/include/libcmt/rollup.h similarity index 100% rename from sys-utils/libcmt/src/rollup.h rename to sys-utils/libcmt/include/libcmt/rollup.h diff --git a/sys-utils/libcmt/src/util.h b/sys-utils/libcmt/include/libcmt/util.h similarity index 100% rename from sys-utils/libcmt/src/util.h rename to sys-utils/libcmt/include/libcmt/util.h diff --git a/sys-utils/libcmt/src/abi.c b/sys-utils/libcmt/src/abi.c index 6372915..f7ccc89 100644 --- a/sys-utils/libcmt/src/abi.c +++ b/sys-utils/libcmt/src/abi.c @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "abi.h" +#include "libcmt/abi.h" #include #include diff --git a/sys-utils/libcmt/src/buf.c b/sys-utils/libcmt/src/buf.c index 63c828d..e2cbf5a 100644 --- a/sys-utils/libcmt/src/buf.c +++ b/sys-utils/libcmt/src/buf.c @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "buf.h" +#include "libcmt/buf.h" #include #include diff --git a/sys-utils/libcmt/src/io-mock.c b/sys-utils/libcmt/src/io-mock.c index e40b243..8338008 100644 --- a/sys-utils/libcmt/src/io-mock.c +++ b/sys-utils/libcmt/src/io-mock.c @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "io.h" -#include "util.h" +#include "libcmt/io.h" +#include "libcmt/util.h" #include #include diff --git a/sys-utils/libcmt/src/io.c b/sys-utils/libcmt/src/io.c index afba048..f18d412 100644 --- a/sys-utils/libcmt/src/io.c +++ b/sys-utils/libcmt/src/io.c @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "io.h" -#include "util.h" +#include "libcmt/io.h" +#include "libcmt/util.h" #include #include diff --git a/sys-utils/libcmt/src/keccak.c b/sys-utils/libcmt/src/keccak.c index a282ba9..6b82e4c 100644 --- a/sys-utils/libcmt/src/keccak.c +++ b/sys-utils/libcmt/src/keccak.c @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "keccak.h" -#include "abi.h" +#include "libcmt/keccak.h" +#include "libcmt/abi.h" #include diff --git a/sys-utils/libcmt/src/merkle.c b/sys-utils/libcmt/src/merkle.c index e58007d..b6dcd2a 100644 --- a/sys-utils/libcmt/src/merkle.c +++ b/sys-utils/libcmt/src/merkle.c @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "merkle.h" -#include "util.h" +#include "libcmt/merkle.h" +#include "libcmt/util.h" #include #include diff --git a/sys-utils/libcmt/src/rollup.c b/sys-utils/libcmt/src/rollup.c index 9d241e8..8285885 100644 --- a/sys-utils/libcmt/src/rollup.c +++ b/sys-utils/libcmt/src/rollup.c @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "rollup.h" -#include "abi.h" -#include "merkle.h" -#include "util.h" +#include "libcmt/rollup.h" +#include "libcmt/abi.h" +#include "libcmt/merkle.h" +#include "libcmt/util.h" #include #include diff --git a/sys-utils/libcmt/tests/abi-multi.c b/sys-utils/libcmt/tests/abi-multi.c index 4dfa692..0ec3905 100644 --- a/sys-utils/libcmt/tests/abi-multi.c +++ b/sys-utils/libcmt/tests/abi-multi.c @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "abi.h" +#include "libcmt/abi.h" #include #include diff --git a/sys-utils/libcmt/tests/abi-single.c b/sys-utils/libcmt/tests/abi-single.c index 56359b7..a1056db 100644 --- a/sys-utils/libcmt/tests/abi-single.c +++ b/sys-utils/libcmt/tests/abi-single.c @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "abi.h" +#include "libcmt/abi.h" #include #include diff --git a/sys-utils/libcmt/tests/buf.c b/sys-utils/libcmt/tests/buf.c index 2a43597..459159f 100644 --- a/sys-utils/libcmt/tests/buf.c +++ b/sys-utils/libcmt/tests/buf.c @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "buf.h" +#include "libcmt/buf.h" #include #include #include diff --git a/sys-utils/libcmt/tests/gio.c b/sys-utils/libcmt/tests/gio.c index 2bd4d8c..bb8f833 100644 --- a/sys-utils/libcmt/tests/gio.c +++ b/sys-utils/libcmt/tests/gio.c @@ -1,6 +1,6 @@ #include "data.h" -#include "rollup.h" -#include "util.h" +#include "libcmt/rollup.h" +#include "libcmt/util.h" #include #include #include diff --git a/sys-utils/libcmt/tests/keccak.c b/sys-utils/libcmt/tests/keccak.c index dbb7e80..027aa01 100644 --- a/sys-utils/libcmt/tests/keccak.c +++ b/sys-utils/libcmt/tests/keccak.c @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "keccak.h" -#include "abi.h" +#include "libcmt/keccak.h" +#include "libcmt/abi.h" #include #include diff --git a/sys-utils/libcmt/tests/merkle.c b/sys-utils/libcmt/tests/merkle.c index 882b282..f552720 100644 --- a/sys-utils/libcmt/tests/merkle.c +++ b/sys-utils/libcmt/tests/merkle.c @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "merkle.h" +#include "libcmt/merkle.h" #include #include diff --git a/sys-utils/libcmt/tests/progress.c b/sys-utils/libcmt/tests/progress.c index 9c5a9dc..d214b67 100644 --- a/sys-utils/libcmt/tests/progress.c +++ b/sys-utils/libcmt/tests/progress.c @@ -1,4 +1,4 @@ -#include "rollup.h" +#include "libcmt/rollup.h" #include #include #include diff --git a/sys-utils/libcmt/tests/rollup.c b/sys-utils/libcmt/tests/rollup.c index 3afec4f..750213c 100644 --- a/sys-utils/libcmt/tests/rollup.c +++ b/sys-utils/libcmt/tests/rollup.c @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "rollup.h" +#include "libcmt/rollup.h" +#include "libcmt/util.h" #include "data.h" -#include "util.h" #include #include #include diff --git a/sys-utils/libcmt/tools/funsel.c b/sys-utils/libcmt/tools/funsel.c index 2fe43f3..7673226 100644 --- a/sys-utils/libcmt/tools/funsel.c +++ b/sys-utils/libcmt/tools/funsel.c @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "keccak.h" +#include "libcmt/keccak.h" #include #include