1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2025-01-03 10:06:01 +01:00

adapt rules for new structure of the root directory

This commit is contained in:
q-posev 2021-04-30 19:04:43 +02:00
parent be1bd56ad7
commit 4578fb1a2b
3 changed files with 15 additions and 16 deletions

View File

@ -51,7 +51,7 @@ dist: $(distdir).tar.gz
$(distdir).tar.gz: $(distdir) $(distdir).tar.gz: $(distdir)
tar chof - $(distdir) | gzip -9 -c > $@ tar chof - $(distdir) | gzip -9 -c > $@
rm -rf $(distdir) rm -rf -- $(distdir)
# for now copy entire src/ directory into $(distdir) in order for distcheck rule to work # for now copy entire src/ directory into $(distdir) in order for distcheck rule to work
# later on can be changed to ship only files like *.c *.h *.f90 *.so *.mod # later on can be changed to ship only files like *.c *.h *.f90 *.so *.mod
@ -62,6 +62,9 @@ $(distdir): FORCE
cp $(srcdir)/config.h.in $(distdir) cp $(srcdir)/config.h.in $(distdir)
cp $(srcdir)/install-sh $(distdir) cp $(srcdir)/install-sh $(distdir)
cp -r $(srcdir)/src $(distdir) cp -r $(srcdir)/src $(distdir)
cp -r $(srcdir)/tests $(distdir)
cp -r $(srcdir)/lib $(distdir)
cp -r $(srcdir)/include $(distdir)
cp $(srcdir)/Makefile.in $(distdir) cp $(srcdir)/Makefile.in $(distdir)
cp $(srcdir)/LICENSE $(distdir) cp $(srcdir)/LICENSE $(distdir)
@ -74,12 +77,12 @@ FORCE:
distcheck: $(distdir).tar.gz distcheck: $(distdir).tar.gz
gzip -cd $(distdir).tar.gz | tar xvf - gzip -cd $(distdir).tar.gz | tar xvf -
cd $(distdir) && \ cd $(distdir) && \
./configure CC="$(CC)" CFLAGS="$(CFLAGS)" && \ ./configure prefix=$${PWD}/$(distdir) CC="$(CC)" CFLAGS="$(CFLAGS)" && \
$(MAKE) all && \ $(MAKE) all && \
$(MAKE) check && \ $(MAKE) check && \
$(MAKE) DESTDIR=$${PWD}/_inst install && \ $(MAKE) DESTDIR=$${PWD}/_inst install && \
$(MAKE) clean $(MAKE) clean
rm -rf $(distdir) rm -rf -- $(distdir)
@echo "*** Package $(distdir).tar.gz is ready for distribution." @echo "*** Package $(distdir).tar.gz is ready for distribution."

View File

@ -69,7 +69,8 @@ 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) cp libtrexio.so $(libdir)
cp $(HEADER_FILES) $(includedir)
fortran: trexio_f.o fortran: trexio_f.o
@ -78,6 +79,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) cp -- trexio.mod $(includedir)
cp -- trexio_f.o ../tests
cppcheck: cppcheck.out cppcheck: cppcheck.out
@ -101,7 +103,7 @@ 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) cp trexio.mod $(DESTDIR)$(includedir)
clean: clean:
@ -109,7 +111,7 @@ clean:
clean-all: clean-all:
$(RM) -- *.c *.h *.o libtrexio.so trexio.mod $(RM) -- *.c *.h *.o libtrexio.so trexio_f.f90 trexio.mod
%.o: %.c $(HEADER_FILES) %.o: %.c $(HEADER_FILES)

View File

@ -44,18 +44,12 @@ check: test_c test_f
./test_f ./test_f
test_c: upd_trexio test.c test_c: test.c
$(CC) $(CPPFLAGS) -I$(includedir) $(CFLAGS) -Wl,-rpath,$(PWD) -L. test.c -ltrexio $(LDFLAGS) $(LIBS) -o test_c $(CC) $(CPPFLAGS) -I$(includedir) $(CFLAGS) test.c $(LDFLAGS) -ltrexio $(LIBS) -o test_c
test_f: upd_trexio test.f90 test_f: trexio_f.o test.f90
$(FC) $(CPPFLAGS) -I$(includedir) $(FCFLAGS) -Wl,-rpath,$(PWD) -L. test.f90 trexio_f.o -ltrexio $(LDFLAGS) $(LIBS) -o test_f $(FC) $(CPPFLAGS) -I$(includedir) $(FCFLAGS) test.f90 trexio_f.o $(LDFLAGS) -ltrexio $(LIBS) -o test_f
upd_trexio: $(trexio_src)/libtrexio.so $(trexio_src)/trexio_f.o
cp $(trexio_src)/libtrexio.so .
cp $(trexio_src)/trexio_f.o .
cp $(trexio_src)/trexio.mod $(includedir)
clean: clean: