Skip to content

Commit

Permalink
Adjusted build script for version 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Carter committed Jan 25, 2016
1 parent 722b4e1 commit d49af9e
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ config.status
tests/Makefile
*.tar.gz
datetime-fortran.pc
tests/datetime_tests
src/tests/datetime_tests

1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Milan Curcic <mcurcic@wavebitscientific.com>
5 changes: 5 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Milan Curcic <mcurcic@wavebitscientific.com>
Bjoern Hendrik Fock <bjoern.fock@uni-hamburg.de>
Marco Galli <marcofgalli@gmail.com>
Huziy Oleksandr Sasha <https://github.com/guziy>
Mark Carter <alt.mcarter@gmail.com>
Empty file removed ChangeLog
Empty file.
32 changes: 1 addition & 31 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,36 +1,6 @@
#libdatetime_la_SOURCES = datetime.f90

AM_FCFLAGS = -Wall -O0 -C -fbacktrace

# Note that we specify '.' first to ensure this dir is build before tests
SUBDIRS = . tests
SUBDIRS = src/lib src/tests

pkgconfig_DATA = datetime-fortran.pc

#datetime_SOURCES = datetime.f90
lib_LIBRARIES = libdatetime.a
#datetime_moduledir = $(libdir)
#datetime_module_LIBRARIES = datetime_module.mod

libdatetime_a_SOURCES = datetime.f90

datetime_module.mod datetime.o : datetime.f90
$(FC) -c datetime.f90

libdatetime.a : datetime.o
ar r libdatetime.a datetime.o

CLEANFILES =*.mod datetime-fortran.pc

#MAINTAINERCLEANFILES = *.gz aclocal.m4 depcomp install.sh missing \
# autoscan.log Makefile.in test-driver

scrub-clean :
scrub-clean.sh


install-exec-hook : datetime_module.mod
cp datetime_module.mod $(libdir)

uninstall-hook :
rm $(libdir)/datetime_module.mod
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AC_PREREQ([2.69])
AC_INIT([datetime-fortran], [1.2.0T])
AC_CONFIG_SRCDIR([datetime.f90])
AC_INIT([datetime-fortran], [1.3.0T])

This comment has been minimized.

Copy link
@zbeekman

zbeekman Jan 26, 2016

Collaborator

@blippy Does this line set the version number of the project? What is the "T" about? Is there anyway that this could get populated via git describe ... so it doesn't need to be updated each time the project is tagged?

This comment has been minimized.

Copy link
@blippy

blippy Jan 26, 2016

The T was just for testing.

I think having some way of making sure things are consistent is a good idea, and I have noted this in #23

However, I don't think we can use git describe, because there is a chicken-and-egg problem: You don't know the version number until the repo has been tagged, but then if you change what's in configure.ac, it is not longer part of the tag.

Unless someone knows differently, of course.

This comment has been minimized.

Copy link
@zbeekman

zbeekman Jan 26, 2016

Collaborator

Good point. My only potential idea was to use filters (smudge and clean) but I think that's a bad idea. Let's not try to get too clever and use git describe due to the problems you noted.

This comment has been minimized.

Copy link
@blippy

blippy Jan 26, 2016

I was thinking of writing a bash script for creating releases:

  1. The bash script gets the version number from configure.ac
  2. It compares it with src/datetime.f90 to ensure they are the same 9for consistency purposes)
  3. It creates a tag based on that version number

What I haven't figured out yet is if tarballs should be created using make dist or git archive. Any suggestions welcome.

This comment has been minimized.

Copy link
@zbeekman

zbeekman Jan 26, 2016

Collaborator

I would make the tarball with make dist and try to get it to include the LICENSE, README, etc.

This comment has been minimized.

Copy link
@blippy

blippy Jan 26, 2016

The question is: is that possible? OK, so we can use "make dist" create the tarball, but how do we get github to host it?

And is that necessarily desirable? It makes sense to tag a release so that it could be reproduced if necessary, but I don't know if that works as an idea. "configure" isn't part of the repo, for example. That's what I'm trying to get my head around.

This comment has been minimized.

Copy link
@zbeekman

zbeekman Jan 27, 2016

Collaborator

If it's not possible, maybe the bash script could use tar to append the files to the tarball/archive?

Getting the release hosted is easy see: https://help.github.com/articles/editing-and-deleting-releases/

You can just add arbirtrary binary files to releases. It has to be done manually but that's ok

This comment has been minimized.

Copy link
@blippy

blippy Jan 27, 2016

Cool beans. I've still to add the missing files to the make dist. I'll get onto it.

AC_CONFIG_SRCDIR([src/lib/datetime.f90])

# foreign flag tells that we are not conforming to the GNU standards
# and hence can ommit NEWS, README, COPYING
Expand All @@ -14,7 +14,7 @@ PKG_INSTALLDIR
AC_PROG_FC([gfortran], [Fortran 90]) # we need a Fortran 90 compiler
AC_PROG_RANLIB # needed to create libraries

AC_CONFIG_FILES([Makefile tests/Makefile])
AC_CONFIG_FILES([Makefile src/lib/Makefile src/tests/Makefile])
# Generate a PC file so that others can easily detect our libraries:
AC_CONFIG_FILES([datetime-fortran.pc:datetime-fortran.pc.in])

Expand Down
8 changes: 4 additions & 4 deletions scrub-clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Try to get rid of a lot of stuff generated by all the autotools

clean_objs () { (cd $1 ; rm -f *.o *.mod *.a ;); }
clean_dir () { (cd $1 ; rm -f Makefile Makefile.in *.o *.mod *.a datetime_tests ;); }

rm -f configure

Expand All @@ -13,7 +13,7 @@ rm -f config.log config.status configure.scan

rm -rf autom4te.cache

(cd tests ; rm -f Makefile Makefile.in datetime_tests)
#(cd tests ; rm -f Makefile Makefile.in datetime_tests)

clean_objs .
clean_objs tests
clean_dir src/lib
clean_dir src/tests
26 changes: 0 additions & 26 deletions src/lib/Makefile

This file was deleted.

33 changes: 33 additions & 0 deletions src/lib/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Items needed specifically by autotools
AM_FCFLAGS = -Wall -O0 -C -fbacktrace

lib_LIBRARIES = libdatetime.a

libdatetime_a_SOURCES = datetime.f90 mod_datetime.f90 mod_timedelta.f90 \
mod_strftime.f90 mod_clock.f90 mod_constants.f90

CLEANFILES = *.mod

# Mostly unchanged from original upstream Makefile
OBJS = datetime.o mod_clock.o mod_datetime.o mod_timedelta.o mod_strftime.o mod_constants.o

.f90.o:
$(FC) -c $(AM_FCFLAGS) $<

libdatetime.a : datetime.o
ar ruv libdatetime.a $(OBJS)

datetime_module.mod : datetime.o

install-exec-hook : datetime_module.mod
cp datetime_module.mod $(libdir)

uninstall-hook :
rm $(libdir)/datetime_module.mod

datetime.o : datetime.f90 mod_clock.o mod_datetime.o mod_strftime.o mod_timedelta.o
mod_clock.o: mod_clock.f90 mod_datetime.o mod_timedelta.o
mod_datetime.o: mod_datetime.f90 mod_constants.o mod_strftime.o mod_timedelta.o
mod_timedelta.o: mod_timedelta.f90
mod_strftime.o: mod_strftime.f90
mod_constants.o: mod_constants.f90
22 changes: 17 additions & 5 deletions src/tests/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
# Items needed specifically by autotools
AM_FCFLAGS = -Wall -O0 -C -fbacktrace

# we use `check' to denote that we don't want them installed
noinst_PROGRAMS = datetime_tests
#TESTS=datetime_tests
#datetime_tests_SOURCES = datetime_tests

datetime_tests_SOURCES = datetime_tests.f90

datetime_tests$(EXEEXT) : datetime_tests.f90 ../datetime_module.mod
$(FC) -I.. $< -o $@ -L.. -ldatetime
#datetime_tests$(EXEEXT) : datetime_tests.f90 ../datetime_module.mod
# $(FC) -I.. $< -o $@ -L.. -ldatetime

CLEANFILES = *.mod

# Mostly unchanged from original upstream Makefile
LIB = ../lib
INCLUDE = ../lib


OBJ = datetime_tests.o

.f90.o:
$(FC) -c $(AM_FCFLAGS) -I$(INCLUDE) $<

datetime_tests$(EXEEXT): datetime_tests.o
$(FC) $(FCFLAGS) $(OBJ) -L$(LIB) -ldatetime -o $@

24 changes: 0 additions & 24 deletions src/tests/Makefile.ori

This file was deleted.

0 comments on commit d49af9e

Please sign in to comment.