TARGETS=$(patsubst %.c,%,$(wildcard *.c))
BINDIR=/usr/local/selinux/bin
LDFLAGS=-L../src 
LDLIBS=-lsecure
CFLAGS=-I../include -I/usr/local/selinux/include

ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
TARGETS+= $(patsubst %.c,%,$(wildcard arch/$(ARCH)/*.c))

# Only install the programs that are useful to users
# and that are not redundant with the modified utilities.
UTILS=avc_enforcing avc_toggle load_policy 
# Add 'chsid' and 'lchsid' if you do not have 'chcon'.
# Add 'exec_s' if you do not have 'runas'.
# Add 'getsecsid' if you do not have the modified 'id'.
# Add 'lstat_s' and 'stat_s' if you do not have the modified 'stat'.
# Add 'mkdir_s' if you do not have the modified mkdir.

all: $(TARGETS)

clean:
	rm -f $(TARGETS) *.o

install: all
	mkdir -p $(BINDIR)
	install -m 755 $(UTILS) $(BINDIR)
