| OS = $(shell uname -s) |
| RELEASE = $(shell uname -r) |
| |
| ifeq "$(OS)" "Linux" |
| CFLAGS = -D__LINUX__ |
| CFLAGS += -DHAVE_NTOHLL |
| CFLAGS += -DHAVE_UTIMENSAT |
| else |
| ifeq "$(OS)" "SunOS" |
| CFLAGS = -D__SOLARIS__ |
| ifeq "$(RELEASE)" "5.11" |
| CFLAGS += -DHAVE_NTOHLL |
| CFLAGS += -DHAVE_UTIMENSAT |
| endif |
| endif |
| endif |
| |
| CC = gcc |
| CFLAGS += -O2 -g -Wall -Werror |
| DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@ |
| LDFLAGS = $(LIBS) |
| AR = ar |
| ARFLAGS = rc |
| OBJECTS = far-rcv.o far-crc32c.o far-endian.o far-xattr.o |
| TARGET_LIB = far-rcv.a |
| |
| all: $(TARGET_LIB) |
| |
| $(TARGET_LIB): $(OBJECTS) |
| $(AR) $(ARFLAGS) $@ $(OBJECTS) |
| |
| .c.o: |
| $(CC) $(DEPFLAGS) $(CFLAGS) -c $< |
| |
| clean: |
| -rm -rf $(TARGET_LIB) $(OBJECTS) .*.d |
| |
| -include .*.d |