From 58dd684c4e86944301959a140dbed9746df35779 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 5 Dec 2023 00:03:04 +0100 Subject: Second commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7b0ecb3..01e23e2 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +# See LICENSE file for copyright and license details. .POSIX: # Choose either yes or no (determines whether system call, @@ -50,6 +51,9 @@ include $(CONFIGFILE) #extended for each support operating system with the operating system's name as appropriate for filenames OPERATING_SYSTEMS = +#extended with supported architectures for each operating system +TEST_ENV = + #extended for each support operating system with the number of syscall parameters they use NPARAMS = @@ -81,9 +85,26 @@ SUBHDR =\ libsyscalls/internal-end.h\ libsyscalls/short-enums.h +TESTUTILS =\ + testutil/get-datatype-description.tu\ + testutil/get-error.tu\ + testutil/get-section-fraction.tu\ + testutil/get-signals.tu\ + testutil/get-syscall-errors.tu\ + testutil/get-syscall-range.tu\ + testutil/is-section-half.tu\ + testutil/is-section-quarter.tu\ + testutil/is-datatype-struct.tu\ + testutil/list-errors.tu\ + testutil/perror-all.tu\ + testutil/perror-bad.tu\ + testutil/strerror-all.tu\ + testutil/strerror-bad.tu + + .SUFFIXES: -.SUFFIXES: .lo .o .c +.SUFFIXES: .lo .o .c .tu include linux/$(LINUX_SUPPORT).mk @@ -93,11 +114,14 @@ include $(CONFIGFILE) # Reloading the user's config as the makefiles for the OS # may have made changes to what is supported +TEST_ENV += SUPPORTED_OSES="$(OPERATING_SYSTEMS)" + LOBJ = $(OBJ:.o=.lo) $(OBJ): $(HDR) $(LOBJ): $(HDR) +$(TESTUTILS): $(HDR) libsyscalls.a .c.o: $(CC) -c -o $@ $< $(CFLAGS) $(IMPORTANT_CFLAGS) $(CPPFLAGS) $(IMPORTANT_CPPFLAGS) @@ -105,6 +129,9 @@ $(LOBJ): $(HDR) .c.lo: $(CC) -fPIC -c -o $@ $< $(CFLAGS) $(IMPORTANT_CFLAGS) $(CPPFLAGS) $(IMPORTANT_CPPFLAGS) +.c.tu: + $(CC) -o $@ $< libsyscalls.a $(CFLAGS) $(CPPFLAGS) + libsyscalls.a: $(OBJ) @rm -f -- $@ $(AR) rc $@ $(OBJ) @@ -113,6 +140,11 @@ libsyscalls.a: $(OBJ) libsyscalls.$(LIBEXT): $(LOBJ) $(CC) $(LIBFLAGS) -o $@ $(LOBJ) $(LDFLAGS) + +check: $(TESTUTILS) + env CPP="$(CPP)" $(TEST_ENV) ./test + + install: libsyscalls.a libsyscalls.$(LIBEXT) mkdir -p -- "$(DESTDIR)$(PREFIX)/lib" mkdir -p -- "$(DESTDIR)$(PREFIX)/include/libsyscalls" @@ -143,7 +175,7 @@ buildclean: semiclean semiclean: -rm -f -- *.o *.lo *.su *.gch *.gcov *.gcno *.gcda .*.tmp -rm -f -- */*.o */*.lo */*.su */*.gch */*.gcov */*.gcno */*.gcda - -rm -f -- *.a *.so *.so.* *.dll *.dylib *.$(LIBEXT) + -rm -f -- *.a *.so *.so.* *.dll *.dylib *.$(LIBEXT) */*.tu -rm -f -- libsyscalls/short-enums.h -.PHONY: all download install uninstall clean semiclean +.PHONY: all download check install uninstall clean semiclean -- cgit v1.2.3-70-g09d2