2013-02-20 15:32:30 +00:00
|
|
|
include ../../scripts/Makefile.include
|
2013-12-09 16:14:23 +00:00
|
|
|
include ../../perf/config/utilities.mak # QUIET_CLEAN
|
2013-02-20 15:32:30 +00:00
|
|
|
|
2013-05-17 20:27:44 +00:00
|
|
|
CC = $(CROSS_COMPILE)gcc
|
|
|
|
AR = $(CROSS_COMPILE)ar
|
|
|
|
|
2013-02-20 15:32:30 +00:00
|
|
|
# guard against environment variables
|
|
|
|
LIB_H=
|
|
|
|
LIB_OBJS=
|
|
|
|
|
2013-12-09 16:14:23 +00:00
|
|
|
LIB_H += fs/debugfs.h
|
2013-12-09 16:14:24 +00:00
|
|
|
LIB_H += fs/fs.h
|
2013-02-20 15:32:30 +00:00
|
|
|
|
2013-12-09 16:14:23 +00:00
|
|
|
LIB_OBJS += $(OUTPUT)fs/debugfs.o
|
2013-12-09 16:14:24 +00:00
|
|
|
LIB_OBJS += $(OUTPUT)fs/fs.o
|
2013-02-20 15:32:30 +00:00
|
|
|
|
2013-12-09 16:14:23 +00:00
|
|
|
LIBFILE = libapikfs.a
|
2013-02-20 15:32:30 +00:00
|
|
|
|
2013-03-03 19:25:33 +00:00
|
|
|
CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC
|
2013-05-09 04:17:44 +00:00
|
|
|
EXTLIBS = -lelf -lpthread -lrt -lm
|
2013-02-20 15:32:30 +00:00
|
|
|
ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
|
|
|
ALL_LDFLAGS = $(LDFLAGS)
|
|
|
|
|
|
|
|
RM = rm -f
|
|
|
|
|
|
|
|
$(LIBFILE): $(LIB_OBJS)
|
|
|
|
$(QUIET_AR)$(RM) $@ && $(AR) rcs $(OUTPUT)$@ $(LIB_OBJS)
|
|
|
|
|
|
|
|
$(LIB_OBJS): $(LIB_H)
|
|
|
|
|
2013-12-09 16:14:23 +00:00
|
|
|
libapi_dirs:
|
|
|
|
$(QUIET_MKDIR)mkdir -p $(OUTPUT)fs/
|
|
|
|
|
|
|
|
$(OUTPUT)%.o: %.c libapi_dirs
|
2013-02-20 15:32:30 +00:00
|
|
|
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
|
2013-12-09 16:14:23 +00:00
|
|
|
$(OUTPUT)%.s: %.c libapi_dirs
|
2013-02-20 15:32:30 +00:00
|
|
|
$(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
|
2013-12-09 16:14:23 +00:00
|
|
|
$(OUTPUT)%.o: %.S libapi_dirs
|
2013-02-20 15:32:30 +00:00
|
|
|
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
|
|
|
|
|
|
|
|
clean:
|
2013-12-09 16:14:23 +00:00
|
|
|
$(call QUIET_CLEAN, libapi) $(RM) $(LIB_OBJS) $(LIBFILE)
|
2013-02-20 15:32:30 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|