Undoes mod: xfs-cmds:slinx:120772a
[xfstests-dev.git] / include / buildrules
1 #
2 # Copyright (C) 1999 Silicon Graphics, Inc.  All Rights Reserved.
3
4 # This program is free software; you can redistribute it and/or modify it
5 # under the terms of version 2 of the GNU General Public License as published
6 # by the Free Software Fondation.
7
8 # This program is distributed in the hope that it would be useful, but WITHOUT
9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 # FITNESS FOR A PARTICULAR PURPOSE.  Further, any license provided herein,
11 # whether implied or otherwise, is limited to this program in accordance with
12 # the express provisions of the GNU General Public License.  Patent licenses,
13 # if any, provided herein do not apply to combinations of this program with
14 # other product or programs, or any other product whatsoever.  This program is
15 # distributed without any warranty that the program is delivered free of the
16 # rightful claim of any third person by way of infringement or the like.  See
17 # the GNU General Public License for more details.
18
19 # You should have received a copy of the GNU General Public License along with
20 # this program; if not, write the Free Software Foundation, Inc., 59 Temple
21 # Place - Suite 330, Boston MA 02111-1307, USA.
22 # Common build rules for gmake
23 #
24 ifndef _BUILDRULES_INCLUDED_
25 _BUILDRULES_INCLUDED_ = 1
26
27 include $(TOPDIR)/include/builddefs
28
29 #
30 # Standard targets
31 #
32 ifdef CMDTARGET
33 $(CMDTARGET) : $(SUBDIRS) $(OBJECTS)
34         $(CCF) -o $(CMDTARGET) $(LDFLAGS) $(OBJECTS) $(LDLIBS) 
35 $(CMDTARGET).static : $(SUBDIRS) $(OBJECTS)
36         $(CCF) -static -o $(CMDTARGET).static $(LDFLAGS) $(OBJECTS) $(LDLIBS) 
37 endif
38
39 ifdef LIBTARGET
40 $(LIBTARGET) : $(SUBDIRS) $(OBJECTS)
41         $(CC) $(LDFLAGS) -fPIC -shared -Wl,-soname,$(LIBTARGET) -o $(LIBTARGET) $(OBJECTS) $(LDLIBS)
42 endif
43
44 ifdef STATICLIBTARGET
45 $(STATICLIBTARGET) : $(SUBDIRS) $(OBJECTS)
46         $(AR) crf $(STATICLIBTARGET) $?
47 endif
48
49 clean clobber : $(SUBDIRS)
50         rm -f $(DIRT)
51         $(SUBDIRS_MAKERULE)
52
53 # Never blow away subdirs
54 ifdef SUBDIRS
55 .PRECIOUS: $(SUBDIRS)
56 $(SUBDIRS):
57         $(SUBDIRS_MAKERULE)
58 endif
59
60 source :
61         $(SOURCE_MAKERULE)
62
63 endif
64
65 $(_FORCE):
66
67 .PHONY : depend
68
69 depend : $(CFILES) $(HFILES)
70         $(SUBDIRS_MAKERULE)
71         touch dep
72         $(MAKEDEPEND) -fdep -- $(CFLAGS) -- $(CFILES)
73
74 # Include dep, but only if it exists
75 ifeq ($(shell test -f dep && echo dep), dep)
76 include dep
77 endif