| ifeq ($(CC),cc) |
| CC := gcc |
| endif |
| CFLAGS += -Wall -Os -fPIC |
| |
| TARGETS := privilege-mac-priv.so privilege-solaris.so |
| |
| KERNEL_NAME = $(shell uname -s) |
| ifeq ($(findstring FreeBSD,$(KERNEL_NAME)),FreeBSD) |
| default: privilege-mac-priv.so |
| else ifeq ($(KERNEL_NAME),SunOS) |
| default: privilege-solaris.so |
| else |
| default: |
| @printf "No default target for '%s'.\\nUse '%s <target> [...]' for cross-building; where targets are:\\n" "$(KERNEL_NAME)" "$(MAKE)" |
| @for i in $(TARGETS); do echo " $$i"; done |
| endif |
| |
| privilege-mac-priv.so: privilege.o list.o mac-priv.o |
| $(CC) $(LDFLAGS) --shared $^ -o $@ $(LIBS) |
| |
| privilege-solaris.so: privilege.o list.o solaris.o |
| $(CC) $(LDFLAGS) --shared $^ -o $@ $(LIBS) |
| |
| clean: |
| rm -f *.o $(TARGETS) |