Home | History | Annotate | Download | only in pp
      1 # Installation directories.
      2 PREFIX ?= $(DESTDIR)/usr
      3 INCLUDEDIR ?= $(PREFIX)/include
      4 SBINDIR ?= $(PREFIX)/sbin
      5 MANDIR = $(PREFIX)/share/man
      6 LIBDIR ?= $(PREFIX)/lib
      7 LIBEXECDIR ?= $(PREFIX)/libexec
      8 HLLDIR ?= $(LIBEXECDIR)/selinux/hll
      9 
     10 CFLAGS ?= -Werror -Wall -W
     11 override CFLAGS += -I$(INCLUDEDIR)
     12 LDLIBS = -lsepol -L$(LIBDIR)
     13 
     14 PP_SRCS = $(wildcard *.c)
     15 PP_OBJS = $(patsubst %.c,%.o,$(PP_SRCS))
     16 
     17 all: pp
     18 
     19 pp: $(PP_OBJS)
     20 	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
     21 
     22 %.o: %.c
     23 	$(CC) $(CFLAGS) -c -o $@ $^
     24 
     25 install: all
     26 	-mkdir -p $(HLLDIR)
     27 	install -m 755 pp $(HLLDIR)
     28 
     29 relabel:
     30 
     31 clean:
     32 	-rm -f pp $(PP_OBJS)
     33 
     34 indent:
     35 	../../scripts/Lindent $(wildcard *.[ch])
     36