# Installation directories.
PREFIX ?= /usr/local/selinux
LIBDIR ?= $(PREFIX)/lib

TARGET=libselinux.a
OBJS= $(patsubst %.c,%.o,$(wildcard *.c))
CFLAGS = -Wall -I../include 

all: $(TARGET)

$(TARGET):  $(OBJS)
	$(AR) rcs $@ $^
	ranlib $@

%.o:  %.c
	$(CC) -o $@ -c $(CFLAGS) $<

install: all
	test -d $(LIBDIR) || install -m 755 -o root -g root -d $(LIBDIR)
	install -m 644 -o root -g root $(TARGET) $(LIBDIR)

clean: 
	rm -f $(OBJS) $(TARGET) 

