- move default values to site-specific Makefile
[build.git] / Makefile
1 #
2 # PlanetLab RPM generation
3 #
4 # Mark Huang <mlhuang@cs.princeton.edu>
5 # Copyright (C) 2003-2006 The Trustees of Princeton University
6 #
7 # $Id: Makefile,v 1.85 2006/03/08 21:29:25 mlhuang Exp $
8 #
9
10 # Default target
11 all:
12
13 # By default, the naming convention for built RPMS is
14 # <name>-<version>-<release>.<PLDISTRO>.<arch>.rpm
15 # Set PLDISTRO on the command line to differentiate between downstream
16 # variants.
17 PLDISTRO := planetlab
18
19 include $(PLDISTRO).mk
20
21 RPMBUILD ?= rpmbuild
22 CVS_RSH ?= ssh
23
24 ifeq ($(findstring $(package),$(ALL)),)
25
26 # Build all packages
27 all: $(ALL)
28
29 # Recurse
30 $(ALL):
31         $(MAKE) package=$@
32
33 # Remove files generated by this package
34 $(foreach package,$(ALL),$(package)-clean): %-clean:
35         $(MAKE) package=$* clean
36
37 # Remove all generated files
38 clean:
39         rm -rf BUILD RPMS SOURCES SPECS SRPMS .rpmmacros tmp parseSpec
40
41 .PHONY: all $(ALL) $(foreach package,$(ALL),$(package)-clean) clean
42
43 else
44
45 # Define variables for Rules.mk
46 CVSROOT := $(if $($(package)-CVSROOT),$($(package)-CVSROOT),$(CVSROOT))
47 TAG := $(if $($(package)-TAG),$($(package)-TAG),$(TAG))
48 MODULE := $($(package)-MODULE)
49 SPEC := $($(package)-SPEC)
50 RPMFLAGS := $(if $($(package)-RPMFLAGS),$($(package)-RPMFLAGS),$(RPMFLAGS))
51 RPMBUILD := $(if $($(package)-RPMBUILD),$($(package)-RPMBUILD),$(RPMBUILD))
52 CVS_RSH := $(if $($(package)-CVS_RSH),$($(package)-CVS_RSH),$(CVS_RSH))
53
54 include Rules.mk
55
56 endif