2007-12-18 05:09:02 +01:00
2008-06-25 06:38:08 +02:00
###############################################################################
# Copyright (C) 2007-2008 Jonathan Moore Liles #
# #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the #
# Free Software Foundation; either version 2 of the License, or (at your #
# option) any later version. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with This program; see the file COPYING. If not,write to the Free Software #
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
###############################################################################
2007-12-18 05:09:02 +01:00
# Makefile for the Non Sequencer.
2008-05-21 17:21:11 +02:00
#
# Do not edit this file; run `make config` instead.
#
2007-12-18 05:09:02 +01:00
2012-03-03 09:17:36 +01:00
VERSION := 1.9.4
2008-05-18 18:16:47 +02:00
2008-06-09 00:55:38 +02:00
all : .config non -sequencer
2008-05-18 18:16:47 +02:00
2008-06-09 00:55:38 +02:00
.config : configure
2008-05-18 18:16:47 +02:00
@ ./configure
config :
@ ./configure
2008-06-09 00:55:38 +02:00
- i n c l u d e . c o n f i g
2008-02-13 17:23:19 +01:00
SYSTEM_PATH = $( prefix) /share/non-sequencer/
DOCUMENT_PATH = $( prefix) /share/doc/non-sequencer/
2012-02-28 08:46:48 +01:00
PIXMAP_PATH := $( prefix) /share/pixmaps/non-sequencer/
ICON_PATH := $( prefix) /share/icons/
DESKTOP_PATH := $( prefix) /share/applications/
2008-02-13 17:10:41 +01:00
2008-06-09 00:55:38 +02:00
# a bit of a hack to make sure this runs before any rules
i f n e q ( $( CALCULATING ) , y e s )
TOTAL := $( shell $( MAKE) CALCULATING = yes -n 2>/dev/null | sed -n 's/^.*Compiling: \([^"]\+\)"/\1/p' > .files )
e n d i f
2008-05-18 18:16:47 +02:00
i f e q ( $( USE_DEBUG ) , y e s )
CXXFLAGS := -pipe -ggdb -Wall -Wextra -Wnon-virtual-dtor -Wno-missing-field-initializers -O0 -fno-rtti -fno-exceptions
e l s e
2008-05-21 06:29:00 +02:00
CXXFLAGS := -pipe -O2 -fno-rtti -fno-exceptions -DNDEBUG
2008-05-18 18:16:47 +02:00
e n d i f
2007-12-18 05:09:02 +01:00
2008-06-25 05:56:38 +02:00
CFLAGS += -DINSTALL_PREFIX= \" $( prefix) \" \
2007-12-18 05:09:02 +01:00
-DSYSTEM_PATH= \" $( SYSTEM_PATH) \" \
2012-02-28 08:46:48 +01:00
-DDOCUMENT_PATH= \" $( DOCUMENT_PATH) \" \
-DPIXMAP_PATH= \" $( PIXMAP_PATH) \"
2007-12-18 05:09:02 +01:00
2012-02-14 09:56:04 +01:00
CXXFLAGS := $( CFLAGS) $( CXXFLAGS) $( FLTK_CFLAGS) $( SIGCPP_CFLAGS) $( LIBLO_CFLAGS) $( XPM_CFLAGS)
2007-12-18 05:09:02 +01:00
2012-02-14 09:56:04 +01:00
LIBS := $( FLTK_LIBS) $( JACK_LIBS) $( SIGCPP_LIBS) $( LIBLO_LIBS) $( XPM_LIBS)
2008-05-18 18:16:47 +02:00
i f e q ( $( JACK_MIDI_PROTO_API ) , y e s )
CXXFLAGS += -DJACK_MIDI_PROTO_API
2007-12-18 05:09:02 +01:00
e n d i f
2008-03-22 21:20:34 +01:00
# uncomment this line to print each playback event to the console (not RT safe)
# CXXFLAGS+= -DDEBUG_EVENTS
2007-12-18 05:09:02 +01:00
2012-02-14 09:56:04 +01:00
SRCS := $( wildcard src/*.C src/gui/*.fl src/gui/*.C src/NSM/*.C)
2008-06-09 00:55:38 +02:00
SRCS := $( SRCS:.fl= .C)
SRCS := $( sort $( SRCS) )
OBJS := $( SRCS:.C= .o)
2007-12-18 05:09:02 +01:00
2008-05-18 18:16:47 +02:00
.PHONEY : all clean install dist valgrind config
2007-12-18 05:09:02 +01:00
clean :
2008-06-09 05:10:16 +02:00
rm -f non-sequencer .deps $( OBJS)
2008-05-18 18:16:47 +02:00
@ echo " $( DONE) "
2007-12-18 05:09:02 +01:00
2008-02-13 08:06:48 +01:00
valgrind :
2008-05-18 19:15:11 +02:00
valgrind ./non-sequencer
2008-02-13 08:06:48 +01:00
2008-05-18 18:16:47 +02:00
i n c l u d e s c r i p t s / c o l o r s
2008-06-09 00:55:38 +02:00
i f n e q ( $( CALCULATING ) , y e s )
COMPILING = " $( BOLD) $( BLACK) [ $( SGR0) $( CYAN) `scripts/percent-complete .files " $<" ` $( SGR0) $( BOLD) $( BLACK) ] $( SGR0) Compiling: $( BOLD) $( YELLOW) $< $( SGR0) "
e l s e
COMPILING = " Compiling: $< "
e n d i f
2007-12-18 05:09:02 +01:00
.C.o :
2008-06-09 00:55:38 +02:00
@ echo $( COMPILING)
2007-12-18 05:09:02 +01:00
@ $( CXX) $( CXXFLAGS) -c $< -o $@
%.C : %.fl
2008-06-14 06:35:27 +02:00
@ cd $( dir $<) && fluid -c $( notdir $<)
2007-12-18 05:09:02 +01:00
2008-06-09 00:55:38 +02:00
$(OBJS) : .config
2008-05-18 18:16:47 +02:00
DONE := $( BOLD) $( GREEN) done $( SGR0)
2008-02-13 17:12:40 +01:00
2008-05-18 19:15:11 +02:00
non-sequencer : $( OBJS )
2007-12-18 05:09:02 +01:00
@ echo -n "Linking..."
@ rm -f $@
2008-06-25 05:56:38 +02:00
@ scripts/build_id .version.c $( VERSION)
@ $( CXX) -c .version.c
@ $( CXX) $( CXXFLAGS) $( LIBS) $( OBJS) .version.o -o $@ || echo " $( BOLD) $( RED) Error! $( SGR0) "
2008-05-18 18:16:47 +02:00
@ if test -x $@ ; then echo " $( DONE) " ; test -x " $( prefix) /bin/ $@ " || echo "You must now run 'make install' (as the appropriate user) to install the executable, documentation and other support files in order for the program to function properly." ; fi
2007-12-18 05:09:02 +01:00
2008-02-14 20:33:06 +01:00
install : all
2007-12-18 05:09:02 +01:00
@ echo -n "Installing..."
2008-09-06 00:36:43 +02:00
@ install -d $( DESTDIR) $( prefix) /bin
@ install -m 755 non-sequencer $( DESTDIR) $( prefix) /bin
@ install -d " $( DESTDIR) $( SYSTEM_PATH) /instruments "
@ install -m 644 instruments/* " $( DESTDIR) $( SYSTEM_PATH) /instruments "
@ install -d " $( DESTDIR) $( DOCUMENT_PATH) "
@ install -m 644 doc/*.html doc/*.png " $( DESTDIR) $( DOCUMENT_PATH) "
2012-02-28 08:46:48 +01:00
@ install -d " $( DESTDIR) $( PIXMAP_PATH) "
@ install -m 644 icons/hicolor/256x256/apps/non-sequencer.png " $( DESTDIR) $( PIXMAP_PATH) " /icon-256x256.png
@ install -d " $( DESTDIR) $( ICON_PATH) /hicolor "
@ cp -au icons/hicolor/ " $( DESTDIR) $( ICON_PATH) "
@ install -d " $( DESTDIR) $( DESKTOP_PATH) "
@ sed 's:@BIN_PATH@:$(prefix)/bin:' non-sequencer.desktop.in > " $( DESTDIR) $( DESKTOP_PATH) /non-sequencer.desktop "
2008-05-18 18:16:47 +02:00
@ echo " $( DONE) "
2008-05-18 19:15:24 +02:00
i f n e q ( $( USE_DEBUG ) , y e s )
@ echo -n "Stripping..."
2008-09-06 00:36:43 +02:00
@ strip $( DESTDIR) $( prefix) /bin/non-sequencer
2008-05-18 19:15:24 +02:00
@ echo " $( DONE) "
e n d i f
2007-12-18 05:09:02 +01:00
2008-02-13 17:23:19 +01:00
dist :
git archive --prefix= non-sequencer-$( VERSION) / v$( VERSION) | bzip2 > non-sequencer-$( VERSION) .tar.bz2
2007-12-18 05:09:02 +01:00
TAGS : $( SRCS )
etags $( SRCS)
2008-06-09 00:55:38 +02:00
.deps : .config $( SRCS )
2008-05-21 06:24:11 +02:00
@ echo -n Calculating dependencies...
2008-06-09 05:10:16 +02:00
@ makedepend -f- -- $( CXXFLAGS) $( INCLUDES) -- $( SRCS) > .deps 2>/dev/null && echo $( DONE)
2007-12-18 05:09:02 +01:00
2008-06-09 05:10:16 +02:00
- i n c l u d e . d e p s