~ubuntu-branches/ubuntu/gutsy/checkpolicy/gutsy

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Russell Coker
  • Date: 2004-05-20 04:32:00 UTC
  • Revision ID: james.westby@ubuntu.com-20040520043200-w4lzkx37dmmc3wt9
Tags: upstream-1.10
ImportĀ upstreamĀ versionĀ 1.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Makefile for building the checkpolicy program
 
3
#
 
4
PREFIX ?= ${DESTDIR}/usr
 
5
BINDIR ?= $(PREFIX)/bin
 
6
MANDIR ?= $(PREFIX)/share/man
 
7
 
 
8
# Set to y for MLS
 
9
MLS=n
 
10
 
 
11
ifeq ($(MLS),y)
 
12
OPTIONS = -DCONFIG_SECURITY_SELINUX_MLS
 
13
OBJS = mls.o
 
14
else
 
15
OPTIONS =
 
16
OBJS =
 
17
endif
 
18
 
 
19
CFLAGS = -g $(OPTIONS) -Wall -O2 -pipe
 
20
 
 
21
override CFLAGS += -include global.h -I. -Iinclude
 
22
 
 
23
OBJS += ebitmap.o hashtab.o symtab.o sidtab.o avtab.o policydb.o services.o y.tab.o lex.yy.o queue.o write.o checkpolicy.o conditional.o
 
24
 
 
25
LIBS=-lfl
 
26
 
 
27
all:  checkpolicy
 
28
 
 
29
checkpolicy: $(OBJS)
 
30
        $(CC) -o $@ $^ $(LIBS)
 
31
 
 
32
%.o: %.c 
 
33
        $(CC) $(CFLAGS) -o $@ -c $<
 
34
 
 
35
y.tab.o: y.tab.c
 
36
        $(CC) $(CFLAGS) -o $@ -c $<
 
37
 
 
38
lex.yy.o: lex.yy.c
 
39
        $(CC) $(CFLAGS) -o $@ -c $<
 
40
 
 
41
y.tab.c: policy_parse.y
 
42
        $(YACC) -d policy_parse.y
 
43
 
 
44
lex.yy.c: policy_scan.l
 
45
        $(LEX) policy_scan.l
 
46
 
 
47
install: all
 
48
        -mkdir -p $(BINDIR)
 
49
        -mkdir -p $(MANDIR)/man8
 
50
        install -m 755 checkpolicy $(BINDIR)    
 
51
        install -m 644 checkpolicy.8 $(MANDIR)/man8
 
52
 
 
53
relabel: install
 
54
        setfilecon system_u:object_r:checkpolicy_exec_t $(BINDIR)/checkpolicy
 
55
 
 
56
clean:
 
57
        rm -f checkpolicy $(OBJS) y.tab.c y.tab.h lex.yy.c 
 
58