From cf84e644b570d4c399a313bab34fd222c0b09009 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Sun, 26 Jan 2020 20:47:18 +0100 Subject: [PATCH] configure.ac: January 2020 move frama-c rules from Makefile.am to src/Makefile.am --- Makefile.am | 46 ++++------------------------------------------ configure.ac | 2 +- src/Makefile.am | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 43 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1a548dd3..94e09266 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,24 +1,3 @@ -.PRECIOUS: session_%.framac -FRAMA_C_FLAGS=-machdep x86_64 \ - -warn-left-shift-negative \ - -warn-right-shift-negative \ - -warn-signed-downcast \ - -warn-signed-overflow \ - -warn-unsigned-downcast \ - -warn-unsigned-overflow \ - -rte \ - -eva \ - -eva-slevel 6 \ - -eva-warn-undefined-pointer-comparison none \ - -eva-ignore-recursive-calls \ - -then \ - -wp \ - -wp-dynamic \ - -wp-steps 100000 \ - -wp-split -wp-literals \ - -wp-timeout 20 -pp-annot \ - -kernel-msg-key pp - SUBDIRS = icons man src docdir ?= $(datadir)/doc/$(PACKAGE) @@ -80,28 +59,11 @@ extras: extrasstatic: $(MAKE) LDFLAGS="$(LDFLAGS) -static" LIBS="$(PTHREAD_LIBS) $(LIBS)" CFLAGS="$(PTHREAD_CFLAGS) $(CFLAGS)" CXXFLAGS="$(PTHREAD_CFLAGS) $(CXXFLAGS)" extras -session_doc.framac: src/file_doc.c src/common.c src/filegen.c src/log.c src/setdate.c - gcc -W -Wall -DMAIN_doc -DHAVE_CONFIG_H -O -o demo -I. $^ - frama-c $^ -cpp-extra-args="-DMAIN_doc -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@ +session_%.framac: + (cd src && $(MAKE) $@) || exit 1; -session_jpg.framac: src/file_jpg.c src/file_tiff.c src/file_tiff_be.c src/file_tiff_le.c src/common.c src/filegen.c src/log.c src/suspend_no.c src/setdate.c - gcc -W -Wall -DMAIN_jpg -DHAVE_CONFIG_H -O -o demo -I. $^ -ljpeg - frama-c $^ -cpp-extra-args="-DMAIN_jpg -DHAVE_CONFIG_H -D__x86_64__ -I/usr/include -I $(frama-c -print-path)/libc" $(FRAMA_C_FLAGS) -save $@ - -session_tiff_be.framac: src/file_tiff.c src/file_tiff_be.c src/file_tiff_le.c src/common.c src/filegen.c src/log.c - gcc -W -Wall -DMAIN_tiff_le -DHAVE_CONFIG_H -O -o demo -I. $^ - frama-c $^ -cpp-extra-args="-DMAIN_tiff_be -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@ - -session_tiff_le.framac: src/file_tiff.c src/file_tiff_be.c src/file_tiff_le.c src/common.c src/filegen.c src/log.c - gcc -W -Wall -DMAIN_tiff_le -DHAVE_CONFIG_H -O -o demo -I. $^ - frama-c $^ -cpp-extra-args="-DMAIN_tiff_le -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@ - -session_%.framac: src/file_%.c src/common.c src/filegen.c src/log.c - gcc -W -Wall -DMAIN_$* -DHAVE_CONFIG_H -O -o demo -I. $^ - frama-c $^ -cpp-extra-args="-DMAIN_$* -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@ - -frama-c-%: session_%.framac - frama-c-gui -load $^ +frama-c-%: + (cd src && $(MAKE) $@) || exit 1; cppcheck: cppcheck --quiet --enable=all -DHAVE_CONFIG_H -I$(builddir) -I/usr/include $(srcdir)/src diff --git a/configure.ac b/configure.ac index df758ccd..451ef50c 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ AC_INIT([testdisk],[7.2-WIP],[grenier@cgsecurity.org]) AC_LANG(C) sinclude(acx_pthread.m4) sinclude(mkdir.m4) -TESTDISKDATE="December 2019" +TESTDISKDATE="January 2020" AC_SUBST(TESTDISKDATE) AC_DEFINE_UNQUOTED([TESTDISKDATE],"$TESTDISKDATE",[Date of release]) AC_CONFIG_AUX_DIR(config) diff --git a/src/Makefile.am b/src/Makefile.am index 2793e0f5..aea1b3b0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,24 @@ +.PRECIOUS: session_%.framac +FRAMA_C_FLAGS=-machdep x86_64 \ + -warn-left-shift-negative \ + -warn-right-shift-negative \ + -warn-signed-downcast \ + -warn-signed-overflow \ + -warn-unsigned-downcast \ + -warn-unsigned-overflow \ + -rte \ + -eva \ + -eva-slevel 6 \ + -eva-warn-undefined-pointer-comparison none \ + -eva-ignore-recursive-calls \ + -then \ + -wp \ + -wp-dynamic \ + -wp-steps 100000 \ + -wp-split -wp-literals \ + -wp-timeout 10 -pp-annot \ + -kernel-msg-key pp + .rc.o: $(WINDRES) --include-dir $(srcdir) $< $@ @@ -405,6 +426,33 @@ small: $(sbin_PROGRAMS) $(bin_PROGRAMS) extras: $(EXTRA_PROGRAMS) +frama-c-%: session_%.framac + frama-c-gui -load $^ + +session_doc.framac: file_doc.c common.c filegen.c log.c setdate.c + gcc $(CFLAGS) -DMAIN_doc -DHAVE_CONFIG_H -O -o demo -I.. $^ + frama-c $^ -cpp-extra-args="-DMAIN_doc -DHAVE_CONFIG_H -D__x86_64__ -I.." $(FRAMA_C_FLAGS) -save $@ + +session_jpg.framac: file_jpg.c file_tiff.c file_tiff_be.c file_tiff_le.c common.c filegen.c log.c suspend_no.c setdate.c + gcc $(CFLAGS) -DMAIN_jpg -DHAVE_CONFIG_H -O -o demo -I.. $^ -ljpeg + frama-c $^ -cpp-extra-args="-DMAIN_jpg -DHAVE_CONFIG_H -D__x86_64__ -I/usr/include -I.. -I $(frama-c -print-path)/libc" $(FRAMA_C_FLAGS) -save $@ 2>&1 | tee session_jpg.log + +session_tiff_be.framac: file_tiff.c file_tiff_be.c file_tiff_le.c common.c filegen.c log.c + gcc $(CFLAGS) -DMAIN_tiff_le -DHAVE_CONFIG_H -O -o demo -I.. $^ + frama-c $^ -cpp-extra-args="-DMAIN_tiff_be -DHAVE_CONFIG_H -D__x86_64__ -I.." $(FRAMA_C_FLAGS) -save $@ + +session_tiff_le.framac: file_tiff.c file_tiff_be.c file_tiff_le.c common.c filegen.c log.c + gcc $(CFLAGS) -DMAIN_tiff_le -DHAVE_CONFIG_H -O -o demo -I.. $^ + frama-c $^ -cpp-extra-args="-DMAIN_tiff_le -DHAVE_CONFIG_H -D__x86_64__ -I.." $(FRAMA_C_FLAGS) -save $@ + +session_%.framac: file_%.c common.c filegen.c log.c + gcc $(CFLAGS) -DMAIN_$* -DHAVE_CONFIG_H -O -o demo -I.. $^ + frama-c $^ -cpp-extra-args="-DMAIN_$* -DHAVE_CONFIG_H -D__x86_64__ -I.." $(FRAMA_C_FLAGS) -save $@ + +session_fidentify.framac: fidentify.c common.c misc.c filegen.c log.c setdate.c file_bmp.c file_list.c + gcc $(CFLAGS) -DMAIN_fidentify -DHAVE_CONFIG_H -O -o demo -I.. $^ + frama-c $^ -cpp-extra-args="-DMAIN_fidentify -DHAVE_CONFIG_H -D__x86_64__ -I.." $(FRAMA_C_FLAGS) -save $@ + moc_qphotorec.cpp: qphotorec.h $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $< -o $@