1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00

create tests directory

This commit is contained in:
q-posev 2021-04-30 15:50:41 +02:00
parent 1e9581e2d2
commit 51660199c2
3 changed files with 22 additions and 20 deletions

View File

@ -29,14 +29,23 @@ LIBS = @LIBS@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
INSTALL = @INSTALL@ INSTALL = @INSTALL@
.PHONY: FORCE all install clean check dist distcheck .PHONY: FORCE all install clean clean-all check dist distcheck
.POSIX: .POSIX:
.SUFFIXES: .SUFFIXES:
all install clean check: all install:
cd src && $(MAKE) $@ cd src && $(MAKE) $@
check:
cd tests && $(MAKE) $@
clean clean-all:
cd src && $(MAKE) $@
cd tests && $(MAKE) $@
dist: $(distdir).tar.gz dist: $(distdir).tar.gz

View File

@ -123,7 +123,8 @@ AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset mkdir strerror]) AC_CHECK_FUNCS([memset mkdir strerror])
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile
src/Makefile]) src/Makefile
tests/Makefile])
AC_OUTPUT AC_OUTPUT
echo \ echo \

View File

@ -59,7 +59,7 @@ ORG_FILES= templates_front/templator_front.org templates_text/templator_text.or
templates_hdf5/templator_hdf5.org templates_hdf5/templator_hdf5.org
.PHONY: all fortran clean install .PHONY: all fortran clean clean-all install
.POSIX: .POSIX:
.SUFFIXES: .SUFFIXES:
@ -69,6 +69,7 @@ all: libtrexio.so fortran
libtrexio.so: $(OBJECT_FILES) $(HEADER_FILES) libtrexio.so: $(OBJECT_FILES) $(HEADER_FILES)
$(CC) -shared $(OBJECT_FILES) -o libtrexio.so $(CC) -shared $(OBJECT_FILES) -o libtrexio.so
cp -- $(HEADER_FILES) $(includedir)
fortran: trexio_f.o fortran: trexio_f.o
@ -76,6 +77,7 @@ fortran: trexio_f.o
trexio_f.o: libtrexio.so trexio_f.f90 trexio_f.o: libtrexio.so trexio_f.f90
$(FC) $(FCFLAGS) -c trexio_f.f90 -o trexio_f.o $(FC) $(FCFLAGS) -c trexio_f.f90 -o trexio_f.o
cp -- trexio.mod $(includedir)
cppcheck: cppcheck.out cppcheck: cppcheck.out
@ -93,31 +95,21 @@ trexio.c trexio_f.f90 trexio.h: $(ORG_FILES)
cd ../tools && ./build_trexio.sh && cd ../src cd ../tools && ./build_trexio.sh && cd ../src
test_c: libtrexio.so test.c
$(CC) $(CPPFLAGS) $(CFLAGS) -Wl,-rpath,$(PWD) -L. test.c -ltrexio $(LDFLAGS) $(LIBS) -o test_c
test_f: libtrexio.so trexio_f.o test.f90
$(FC) $(CPPFLAGS) $(FCFLAGS) -Wl,-rpath,$(PWD) -L. test.f90 trexio_f.o -ltrexio $(LDFLAGS) $(LIBS) -o test_f
check: test_c test_f
$(RM) -r trexio_test
$(RM) -r trexio_test_fort
./test_c
./test_f
# $(DESTDIR) is needed for future support of package managers # $(DESTDIR) is needed for future support of package managers
# install should avoid build target due to possible conflict when prefix overriden # install should avoid build target due to possible conflict when prefix overriden
install: install:
$(INSTALL) -d $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) $(INSTALL) -d $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
cp libtrexio.so $(DESTDIR)$(libdir) cp libtrexio.so $(DESTDIR)$(libdir)
cp trexio*.h $(DESTDIR)$(includedir) cp trexio*.h $(DESTDIR)$(includedir)
# cp trexio.mod $(DESTDIR)$(includedir)
clean: clean:
$(RM) *.o libtrexio.so test_*.h5 test_f test_c $(RM) -- *.o libtrexio.so trexio.mod
$(RM) -r trexio_test/ trexio_test_fort/
clean-all:
$(RM) -- *.c *.h *.o libtrexio.so trexio.mod
%.o: %.c $(HEADER_FILES) %.o: %.c $(HEADER_FILES)