Home | History | Annotate | Download | only in restorecond
      1 # Installation directories.
      2 PREFIX ?= $(DESTDIR)/usr
      3 SBINDIR ?= $(PREFIX)/sbin
      4 LIBDIR ?= $(PREFIX)/lib
      5 MANDIR = $(PREFIX)/share/man
      6 AUTOSTARTDIR = $(DESTDIR)/etc/xdg/autostart
      7 DBUSSERVICEDIR = $(DESTDIR)/usr/share/dbus-1/services
      8 SYSTEMDDIR ?= $(DESTDIR)/usr/lib/systemd
      9 
     10 autostart_DATA = sealertauto.desktop
     11 INITDIR ?= $(DESTDIR)/etc/rc.d/init.d
     12 SELINUXDIR = $(DESTDIR)/etc/selinux
     13 
     14 DBUSFLAGS = -DHAVE_DBUS -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/lib/dbus-1.0/include
     15 DBUSLIB = -ldbus-glib-1 -ldbus-1
     16 
     17 CFLAGS ?= -g -Werror -Wall -W
     18 override CFLAGS += -I$(PREFIX)/include $(DBUSFLAGS) -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib/glib-2.0/include
     19 
     20 LDLIBS += -lselinux $(DBUSLIB) -lglib-2.0 -L$(LIBDIR)
     21 
     22 all: restorecond
     23 
     24 restorecond.o utmpwatcher.o stringslist.o user.o watch.o: restorecond.h
     25 
     26 restorecond:  ../setfiles/restore.o restorecond.o utmpwatcher.o stringslist.o user.o watch.o
     27 	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
     28 
     29 install: all
     30 	[ -d $(MANDIR)/man8 ] || mkdir -p $(MANDIR)/man8
     31 	-mkdir -p $(SBINDIR)
     32 	install -m 755 restorecond $(SBINDIR)
     33 	install -m 644 restorecond.8 $(MANDIR)/man8
     34 	-mkdir -p $(INITDIR)
     35 	install -m 755 restorecond.init $(INITDIR)/restorecond
     36 	-mkdir -p $(SELINUXDIR)
     37 	install -m 644 restorecond.conf $(SELINUXDIR)/restorecond.conf
     38 	install -m 644 restorecond_user.conf $(SELINUXDIR)/restorecond_user.conf
     39 	-mkdir -p $(AUTOSTARTDIR)
     40 	install -m 644 restorecond.desktop $(AUTOSTARTDIR)/restorecond.desktop
     41 	-mkdir -p $(DBUSSERVICEDIR)
     42 	install -m 600 org.selinux.Restorecond.service  $(DBUSSERVICEDIR)/org.selinux.Restorecond.service
     43 	-mkdir -p $(SYSTEMDDIR)/system
     44 	install -m 644 restorecond.service $(SYSTEMDDIR)/system/
     45 relabel: install
     46 	/sbin/restorecon $(SBINDIR)/restorecond 
     47 
     48 clean:
     49 	-rm -f restorecond *.o *~
     50 
     51 indent:
     52 	../../scripts/Lindent $(wildcard *.[ch])
     53 
     54