summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-12-05 00:03:04 +0100
committerMattias Andrée <maandree@kth.se>2023-12-05 00:03:04 +0100
commit58dd684c4e86944301959a140dbed9746df35779 (patch)
treea2702ea4f66b2a58711ee22eb7449c74b1ecf0d1 /Makefile
parentFirst commit (diff)
downloadlibsyscalls-58dd684c4e86944301959a140dbed9746df35779.tar.gz
libsyscalls-58dd684c4e86944301959a140dbed9746df35779.tar.bz2
libsyscalls-58dd684c4e86944301959a140dbed9746df35779.tar.xz
Second commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 35 insertions, 3 deletions
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