/[vps]/baselayout-vserver/trunk/src/core/Makefile
Gentoo

Diff of /baselayout-vserver/trunk/src/core/Makefile

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 126 Revision 127
1# Copyright (C) 2004,2005 Martin Schlemmer <azarah@nosferatu.za.org>
2#
3#
4# This program is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by the
6# Free Software Foundation version 2 of the License.
7#
8# This program is distributed in the hope that it will be useful, but
9# WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11# General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License along
14# with this program; if not, write to the Free Software Foundation, Inc.,
15# 675 Mass Ave, Cambridge, MA 02139, USA.
16#
17# $Header$
18
19CC = gcc
20override CFLAGS += -Wall
21EXTRA_CFLAGS = -DLEGACY_DEPSCAN
22STRIP = strip
23
24DEPSCAN = depscan
25TEST_REGEX = test-regex
26
27TARGETS = $(DEPSCAN)
28CHECK_TARGETS = $(TEST_REGEX)
29
30all: $(TARGETS)
31
32.ALL: all
33
34OBJS = \
35 parse.o \
36 depend.o \
37 simple-regex.o \
38 misc.o
39
40HEADERS = \
41 parse.h \
42 depend.h \
43 simple-regex.h \
44 misc.h \
45 debug.h
46
47
48# cc-option (from linux kernel sources)
49# Usage: cflags-y += $(call gcc-option, -march=winchip-c6, -march=i586)
50
51cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
52 > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
53
54
55ifeq ($(DEBUG),1)
56 override CFLAGS += -ggdb3
57 EXTRA_CFLAGS += -DRC_DEBUG
58endif
59ifeq ($(BOUNDS),1)
60 override CFLAGS += $(call cc-option, -fbounds-checking, -pipe)
61endif
62
63$(DEPSCAN): $(OBJS) $(DEPSCAN).o
64 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $^
65
66$(TEST_REGEX): $(TEST_REGEX).o simple-regex.o
67 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $^
68
69$(OBJS): $(HEADERS)
70
71.c.o:
72 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
73
74check: $(CHECK_TARGETS)
75 @for x in $^; do \
76 ./$${x} || exit 1; \
77 done
78
79strip: $(TARGETS)
80 $(STRIP) -s --remove-section=.note --remove-section=.comment $(TARGETS)
81
82clean:
83 rm -f *.o $(TARGETS) $(CHECK_TARGETS)

Legend:
Removed from v.126  
changed lines
  Added in v.127

  ViewVC Help
Powered by ViewVC 1.1.20