## ----------------------------------------------------------------------------
##                                                                           --
##  Filename        : $Source: /cvsroot/gnade/gnade/cygwin/Makefile,v $
##  Description     : Build RPMS from the distribution                       --
##  Author          : Michael Erdmann <Michael.Erdmann@snafu.de>             --
##  Created On      : 1-May-2002                                             --
##  Last Modified By: $Author: merdmann $                                    --
##  Last Modified On: $Date: 2004/04/25 15:00:31 $                           --
##  Version         : $Revision: 1.1 $
##  Status          : $State: Exp $
##                                                                           --
##  Copyright (C) 2002,2003                                                  --
##                                                                           --
##  GNADE is copyrighted by the persons and institutions enumerated in the   --
##  AUTHORS file. This file is located in the root directory of the          --
##  GNADE distribution.                                                      --
##                                                                           --
##  GNADE is free software;  you can redistribute it  and/or modify it under  --
##  terms of the  GNU General Public License as published  by the Free Soft- --
##  ware  Foundation;  either version 2,  or (at your option) any later ver- --
##  sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
##  OUT 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  distributed with GNAT;  see file COPYING.  If not, write --
##  to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
##  MA 02111-1307, USA.                                                      --
##                                                                           --
##  As a special exception,  if other files  instantiate  generics from      --
##  GNADE Ada units, or you link GNADE Ada units or libraries with other       --
##  files  to produce an executable, these  units or libraries do not by     --
##  itself cause the resulting  executable  to  be covered  by the  GNU      --
##  General  Public  License.  This exception does not however invalidate    --
##  any other reasons why  the executable file  might be covered by the      --
##  GNU Public License.                                                      --
##                                                                           --
##  This package is  implemented to work with GNAT, the GNU Ada compiler.    --
##                                                                           --
##  Contact                                                                  --
##  =======                                                                  --
##  Error reports shall be handled via http://gnade.sourceforge.net          --
##  Features and ideas via: gnade-develop@lists.sourceforge.net              --
##                                                                           --
##  Author contact:                                                          --
##               purl:/net/michael.erdmann                                   --
##                                                                           --
## ----------------------------------------------------------------------------
##
##  Functional Description
##  ======================
##
##  Restrictions
##  ============
##  None
##
##  References
##  ==========
##  None
##
## 
##  
include ../make.conf

DIST=$(exportdir)/gnade-src-$(VERSION).tar.gz

M4FLAGS= --define=VERSION=$(VERSION) \
	 --define=NATIVE_BINDINGS="$(NATIVE_BINDINGS)" \
	 --define=BUILD=`cat .version` 
##
## Per default do nothing
##

##
## Build the rpms
##
package: version
	tar xvf $(DIST)
	m4 $(M4FLAGS) gnade.m4 > gnade.spec
	( export PATH=/usr/local/bin:/usr/gnat/bin:$$PATH && \
	  rpmbuild -b$(STAGE) --target=$(ARCH) gnade.spec ) >build.log 2>build.error

##
## count the build number up each time we make an rpm
##
version:
	@if [ ! -f .version ] ; \
	   then echo 1 > .version ; \
	   else  expr 0`cat .version` + 1 > .version ; \
        fi
	@echo "Package Build : " `cat .version` 
##
##
##
dep:

##
## Cleanup
##
clean:
	rm -rf *~ *~*~ setup.hint *.log

distclean: clean
	rm .version

publish:
	ncftpput upload.sourceforge.net /incoming $(exportdir)/gnade-$(VERSION)-*.src.rpm
	ncftpput upload.sourceforge.net /incoming $(exportdir)/gnade-$(VERSION)-*.i686.rpm
