LIBOUT := libselftest.so

LIBOBJS := selftest.o

PROG_CFLAGS = $(CFLAGS) -Wall -Werror -fstrict-aliasing -g
LIB_LDFLAGS = $(LDFLAGS)

FPIC := -fPIC

.PHONY: all

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

all: $(LIBOUT)

$(LIBOUT): $(LIBOBJS)
	$(CC) $(PROG_CFLAGS) $(LIB_LDFLAGS) -shared -o $@ $^

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