# Examples/DBus/Server/Makefile
#   A makefile for a variety of sample D-Bus servers.  
#
#   Copyright (c) 2013 Samuel A. Rebelsky.  All rights reserved.
#
#   This file is part of The Glimmer Guide to Writing a D-Bus Server.
#
#   The Glimmer Guide to Writing a D-Bus Server 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 3 of the License, or (at your option) any later version.
#
#   The Glimmer Guide to Writing a D-Bus Server 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 software.  If not, see <http://www.gnu.org/licenses/>.

# +--------------------+----------------------------------------------
# | Standard Variables |
# +--------------------+

CFLAGS=-g -Wall -DVERBOSE=1 $(shell pkg-config --cflags gio-2.0)
LDLIBS=$(shell pkg-config --libs gio-2.0)


# +----------------+--------------------------------------------------
# | User Variables |
# +----------------+

# A list of the servers we make
SERVERS = \
        server-v0 \
        server-v1 \
        server-v2 \
        server-v3 \
        server-v4 \
        server-v5 \
        server-x 

# A timestamp.  Can be useful for dating things.
TIMESTAMP = $(shell date +"%Y%m%d")

# The version of this code.
VERSION = 0.01b

# The name of our tarball
TARBALL = gg-dbus-server-$(VERSION)-$(TIMESTAMP).tgz


# +------------------+------------------------------------------------
# | Standard Targets |
# +------------------+

default: $(SERVERS)

clean:
	rm -f *.o
	rm -f *.tgz

distclean: clean
	rm -f $(SERVERS)

test: $(SERVERS)
	echo "No tests implemented.  Sorry."

package: $(TARBALL)


# +-----------------------+-------------------------------------------
# | Miscellaneous Targets |
# +-----------------------+

$(TARBALL): Makefile *.c
	tar cvfz $@ $^
