Skip to content

Commit

Permalink
Autotools in the "test" branch
Browse files Browse the repository at this point in the history
  • Loading branch information
stefantalpalaru committed Jun 20, 2017
1 parent 6b6c6e9 commit 1c1469b
Show file tree
Hide file tree
Showing 41 changed files with 1,748 additions and 18 deletions.
44 changes: 44 additions & 0 deletions .gitignore
Expand Up @@ -2,3 +2,47 @@
!.gitignore
!.travis.yml
!.valgrind.supp

# Object files
*.o
*.ko
*.obj
*.elf
build
tg-timer.res

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
tg-timer
tg-timer-dbg
tg-timer-prf
tg-timer-vlg

# autotools
Makefile
Makefile.in
/autom4te.cache
/aclocal.m4
/compile
/configure
/depcomp
/install-sh
/missing
/stamp-h1
/config.*
/libtool
/ltmain.sh
/test-driver
/test-suite.log
.libs
.deps
.dirstamp
*.log
*.trs
*.tar.gz

6 changes: 4 additions & 2 deletions .travis.yml
Expand Up @@ -38,7 +38,9 @@ before_script:
fi;
if [[ "$TARGET" == "test" ]]; then
mkdir -p ~/.config;
fi
fi;

script:
make "$TARGET"
./autogen.sh;
./configure;
make "$TARGET";
66 changes: 66 additions & 0 deletions Makefile.am
@@ -0,0 +1,66 @@
SUBDIRS = icons
bin_PROGRAMS = tg-timer
EXTRA_PROGRAMS = tg-timer-dbg \
tg-timer-prf \
tg-timer-vlg
MOSTLYCLEANFILES := $(EXTRA_PROGRAMS)

tg_timer_SOURCES = src/algo.c \
src/audio.c \
src/computer.c \
src/config.c \
src/interface.c \
src/output_panel.c \
src/serializer.c \
src/tg.h
if HAVE_WINDRES
tg_timer_SOURCES += tg-timer.res
endif

tg_timer_dbg_SOURCES = $(tg_timer_SOURCES)
tg_timer_prf_SOURCES = $(tg_timer_SOURCES)
tg_timer_vlg_SOURCES = $(tg_timer_SOURCES)

LIBS = $(GTK_LIBS) \
$(GTHREAD_LIBS) \
$(PORTAUDIO_LIBS) \
$(FFTW_LIBS) \
-lpthread \
-lm

AM_CPPFLAGS = -DPROGRAM_NAME=\"tg-timer\" -DVERSION=\"$(PACKAGE_VERSION)\"
tg_timer_dbg_CPPFLAGS = $(AM_CPPFLAGS) -DDEBUG

AM_CFLAGS = $(GTK_CFLAGS) \
$(GTHREAD_CFLAGS) \
$(PORTAUDIO_CFLAGS) \
$(FFTW_CFLAGS)
tg_timer_dbg_CFLAGS = $(AM_CFLAGS) -ggdb
tg_timer_prf_CFLAGS = $(AM_CFLAGS) -pg
tg_timer_vlg_CFLAGS = $(AM_CFLAGS) -g

desktopdir = $(datadir)/applications
desktop_DATA = icons/tg-timer.desktop

dist_man_MANS = docs/tg-timer.1

xdgdatadir = @XDGDATADIR@
mimedir = $(xdgdatadir)/mime
xmldir = $(mimedir)/packages
xml_DATA = icons/tg-timer.xml

EXTRA_DIST := autogen.sh \
icons \
packaging

test: tg-timer-dbg
./tg-timer-dbg test
.PHONY: test

tg-timer.res: icons/tg-timer.rc icons/tg-timer.ico
windres icons/tg-timer.rc -O coff -o $@

valgrind: tg-timer-vlg
valgrind --leak-check=full -v --num-callers=99 --suppressions=.valgrind.supp ./$^
.PHONY: valgrind

File renamed without changes.
20 changes: 14 additions & 6 deletions README.md
Expand Up @@ -49,6 +49,20 @@ The source code of tg can probably be built by any C99 compiler, however
only gcc and clang have been tested. You need the following libraries:
gtk+3, portaudio2, fftw3 (all available as open-source).

Release build:
```sh
git clone https://github.com/vacaboja/tg.git
cd tg
./autogen.sh
./configure
make
```

Debug build:
```sh
make tg-timer-dbg
```

### Compiling on Windows

It is suggested to use the msys2 platform. First install msys2 according
Expand All @@ -65,9 +79,6 @@ issue the following commands.
To compile tg on Debian

sudo apt-get install libgtk-3-dev libjack-jackd2-dev portaudio19-dev libfftw3-dev git
git clone https://github.com/vacaboja/tg.git
cd tg
make

The package libjack-jackd2-dev is not necessary, it only works around a
known bug (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718221).
Expand All @@ -77,6 +88,3 @@ known bug (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718221).
To compile tg on Fedora

sudo dnf install fftw-devel portaudio-devel gtk3-devel
git clone https://github.com/vacaboja/tg.git
cd tg
make

0 comments on commit 1c1469b

Please sign in to comment.