Moved sources to src folder fixing make dist

This commit is contained in:
Yann Weber 2023-04-05 21:39:48 +02:00
commit 1924ecfb3d
35 changed files with 67 additions and 58 deletions

View file

@ -1,33 +1,10 @@
bin_PROGRAMS = asmsh child
SUBDIRS = . src docs
noinst_LIBRARIES= libcheck_asmsh.a
libcheck_asmsh_a_SOURCES = mmap_parse.c asm_env.c breakpoints.c compile.c logger.c \
completion.c history.c \
shell.c shell_cmds.c shell_sym.c \
shell_cmd_breakpoint.c
asmsh_SOURCES = asmsh.c $(libcheck_asmsh_a_SOURCES)
child_SOURCES = child.s
asmsh_LDADD=child_bin.o
asmsh_LDFLAGS=-g -O2
AM_CFLAGS=-Wall -Werror
AM_CCASFLAGS=-g -O0
child_LDFLAGS=-nostdlib
child$(EXEEXT): $(child_SOURCES:.s=.o)
$(LD) -s -o $@ $^
child_bin.o: child$(EXEEXT)
$(LD) -r -b binary -o $@ $<
EXTRA_DIST = regen.sh
ALL_CHECKS=
LINT=
SUBDIRS = . docs
if CHECK
libcheck_asmsh_a_LDDADD=child_bin.o
SUBDIRS += tests
ALL_CHECKS += check
CHECK_STAMP=tests/test-suite.log
@ -36,42 +13,39 @@ $(CHECK_STAMP):
$(MAKE) check
if HAVE_GCOV
libcheck_asmsh_a_CFLAGS = @CFLAGS@ -fprofile-arcs -ftest-coverage
TO_LOCAL_CLEAN=*.gcda *.gcno
if HAVE_LCOV
LCOV_INFO=lcov.info
LCOV_HTML=lcov_html
TO_LOCAL_CLEAN += $(LCOV_INFO) $(LCOV_HTML)
TO_LOCAL_CLEAN = $(LCOV_INFO) $(LCOV_HTML)
$(LCOV_INFO): $(CHECK_STAMP)
$(LCOV) --base-directory $(top_builddir) --capture --no-recursion --directory . --output-file $@
$(LCOV) --base-directory $(top_builddir)/src/ --capture --directory $(top_builddir)/src/ --output-file $@
$(LCOV_HTML): $(LCOV_INFO)
genhtml $< --output-directory $@
endif
clean-local:
-rm -rf $(TO_LOCAL_CLEAN)
endif # HAVE_LCOV
endif
endif # HAVE_GCOV
ALL_CHECKS += coverage
coverage: $(LCOV_HTML)
endif
endif # CHECK
if HAVE_CPPCHECK
LINT += cppcheck
cppcheck:
$(CPPCHECK) --enable=all --inline-suppr --check-config --suppress=missingIncludeSystem -q . -I .
endif
$(CPPCHECK) --enable=all --inline-suppr --check-config --suppress=missingIncludeSystem -q $(top_builddir)/src -I $(top_builddir)/src/
endif # HAVE_CPPCHECK
checks: $(ALL_CHECKS)

View file

@ -26,8 +26,8 @@ fi
AC_CONFIG_SRCDIR([asmsh.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/asmsh.c])
AC_CONFIG_HEADERS([src/config.h])
@ -89,5 +89,5 @@ AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([bzero strtoull, gmtime_r, ptrace])
AC_CONFIG_FILES([Makefile tests/Makefile tests/samples/Makefile])
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile tests/samples/Makefile])
AC_OUTPUT

View file

@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = /home/zered/documents/dev/c/asmsh/docs
OUTPUT_DIRECTORY = @top_srcdir@/docs/
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
@ -864,7 +864,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = @top_srcdir@
INPUT = @top_srcdir@/src
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@ -943,7 +943,7 @@ FILE_PATTERNS = *.c \
# be searched for input files as well.
# The default value is: NO.
RECURSIVE = NO
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a

View file

@ -13,7 +13,7 @@ $(man): $(doxyman)
cp $(doxyman)/asmsh.3 $@
sed -i 's/^.TH "asmsh" 3/.TH "asmsh" 1/' $@
$(stamp): Doxyfile $(top_srcdir)/asmsh.h
$(stamp): Doxyfile $(top_srcdir)/src/asmsh.h
$(DOXYGEN) $^
echo done > $@

40
src/Makefile.am Normal file
View file

@ -0,0 +1,40 @@
bin_PROGRAMS = asmsh child
noinst_LIBRARIES= libcheck_asmsh.a
libcheck_asmsh_a_SOURCES = mmap_parse.c asm_env.c breakpoints.c compile.c logger.c \
completion.c history.c \
shell.c shell_cmds.c shell_sym.c \
shell_cmd_breakpoint.c
asmsh_SOURCES = asmsh.c $(libcheck_asmsh_a_SOURCES)
child_SOURCES = child.s
asmsh_LDADD=child_bin.o
asmsh_LDFLAGS=-g -O2
AM_CFLAGS=-Wall -Werror
AM_CCASFLAGS=-g -O0
child_LDFLAGS=-nostdlib
child$(EXEEXT): $(child_SOURCES:.s=.o)
$(LD) -s -o $@ $^
child_bin.o: child$(EXEEXT)
$(LD) -r -b binary -o $@ $<
if CHECK
libcheck_asmsh_a_LDDADD=child_bin.o
if HAVE_GCOV
libcheck_asmsh_a_CFLAGS = @CFLAGS@ -fprofile-arcs -ftest-coverage
TO_LOCAL_CLEAN=*.gcda *.gcno
clean-local:
-rm -rf $(TO_LOCAL_CLEAN)
endif
endif

View file

@ -1,4 +1,4 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* src/config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the `bzero' function. */
#undef HAVE_BZERO

View file

@ -10,8 +10,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#define CHILD_PATH "../child"
/**@brief Start a asmsh test
*@param const char* suite_str test suite string
*@param const char* tc_str test case string

View file

@ -11,13 +11,11 @@ noinst_HEADERS = asmsh_check.h
SUBDIRS = samples
TESTLIB_NAME=libcheck_asmsh.a
TESTLIB=\$(top_builddir)/\$(TESTLIB_NAME)
TESTLIB=\$(top_builddir)/src/\$(TESTLIB_NAME)
CHILD_NAME=child
CHILD=\$(top_builddir)/\$(CHILD_NAME)
CHILD=\$(top_builddir)/src/\$(CHILD_NAME)
CHILD_OBJNAME=child_bin.o
CHILD_OBJ=\$(top_builddir)/\$(CHILD_OBJNAME)
BUILT_SOURCES = \$(CHILD)
CHILD_OBJ=\$(top_builddir)/src/\$(CHILD_OBJNAME)
clean-local:
-rm -rf *.gcov *.gcda *.gcno
@ -28,7 +26,7 @@ for p in $progs
do
cat << __EOF__ >> Makefile.am
${p}_SOURCES = ${p}.c
${p}_CFLAGS = @CHECK_CFLAGS@ --coverage
${p}_CFLAGS = @CHECK_CFLAGS@ -DCHILD_PATH='"@top_builddir@/src/child"' --coverage
${p}_LDFLAGS = @LDFLAGS@
${p}_LDADD = \$(TESTLIB) \$(CHILD_OBJ) @CHECK_LIBS@ -ldl -lgcov
__EOF__

View file

@ -10,7 +10,6 @@
#include "asm_env.h"
#include "compile.h"
#define REAL_CHILD "../child"
#define STAMP_CHILD "samples/asm_env_stamps"
static const long int stamp1 = 0x4242; // %r15
@ -18,7 +17,7 @@ static const long int stamp2 = -1; // %r14
START_TEST(test_env)
{
const char childpath[] = REAL_CHILD;
const char childpath[] = CHILD_PATH;
asmsh_env_t *env = asmsh_env(childpath);
ck_assert_ptr_nonnull(env);
@ -59,7 +58,7 @@ END_TEST
START_TEST(test_env_exit42)
{
const char childpath[] = REAL_CHILD;
const char childpath[] = CHILD_PATH;
asmsh_asmc_ctx_t *cctx;
asmsh_bytecode_t bcode;
@ -100,7 +99,7 @@ END_TEST
START_TEST(test_env_steps)
{
const char childpath[] = REAL_CHILD;
const char childpath[] = CHILD_PATH;
const char *instr[] = {
"mov $60, %rax",
"mov $0x42,%rdi",
@ -143,7 +142,7 @@ END_TEST
START_TEST(test_env_regs)
{
const char childpath[] = REAL_CHILD;
const char childpath[] = CHILD_PATH;
asmsh_env_t *env = asmsh_env(childpath);
ck_assert_ptr_nonnull(env);
@ -224,7 +223,7 @@ END_TEST
START_TEST(test_embed_env_exit42)
{
const char childpath[] = REAL_CHILD;
const char childpath[] = CHILD_PATH;
asmsh_asmc_ctx_t *cctx;
asmsh_bytecode_t bcode;