2013-02-20 22:32:30 +07:00
|
|
|
include ../../scripts/Makefile.include
|
2013-12-09 23:14:23 +07:00
|
|
|
include ../../perf/config/utilities.mak # QUIET_CLEAN
|
2013-02-20 22:32:30 +07:00
|
|
|
|
2013-05-18 03:27:44 +07:00
|
|
|
CC = $(CROSS_COMPILE)gcc
|
|
|
|
AR = $(CROSS_COMPILE)ar
|
|
|
|
|
2013-02-20 22:32:30 +07:00
|
|
|
# guard against environment variables
|
|
|
|
LIB_H=
|
|
|
|
LIB_OBJS=
|
|
|
|
|
2013-12-09 23:14:23 +07:00
|
|
|
LIB_H += fs/debugfs.h
|
2015-02-03 02:35:04 +07:00
|
|
|
LIB_H += fs/tracefs.h
|
2015-02-03 02:35:03 +07:00
|
|
|
LIB_H += fs/findfs.h
|
2013-12-09 23:14:24 +07:00
|
|
|
LIB_H += fs/fs.h
|
2014-09-04 04:02:59 +07:00
|
|
|
# See comment below about piggybacking...
|
|
|
|
LIB_H += fd/array.h
|
2013-02-20 22:32:30 +07:00
|
|
|
|
2013-12-09 23:14:23 +07:00
|
|
|
LIB_OBJS += $(OUTPUT)fs/debugfs.o
|
2015-02-03 02:35:04 +07:00
|
|
|
LIB_OBJS += $(OUTPUT)fs/tracefs.o
|
2015-02-03 02:35:03 +07:00
|
|
|
LIB_OBJS += $(OUTPUT)fs/findfs.o
|
2013-12-09 23:14:24 +07:00
|
|
|
LIB_OBJS += $(OUTPUT)fs/fs.o
|
2014-09-04 04:02:59 +07:00
|
|
|
# XXX piggybacking here, need to introduce libapikfd, or rename this
|
|
|
|
# to plain libapik.a and make it have it all api goodies
|
|
|
|
LIB_OBJS += $(OUTPUT)fd/array.o
|
2013-02-20 22:32:30 +07:00
|
|
|
|
2013-12-09 23:14:23 +07:00
|
|
|
LIBFILE = libapikfs.a
|
2013-02-20 22:32:30 +07:00
|
|
|
|
2013-03-04 02:25:33 +07:00
|
|
|
CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC
|
2013-05-09 11:17:44 +07:00
|
|
|
EXTLIBS = -lelf -lpthread -lrt -lm
|
2013-02-20 22:32:30 +07: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 23:14:23 +07:00
|
|
|
libapi_dirs:
|
2014-09-04 04:02:59 +07:00
|
|
|
$(QUIET_MKDIR)mkdir -p $(OUTPUT)fd $(OUTPUT)fs
|
2013-12-09 23:14:23 +07:00
|
|
|
|
|
|
|
$(OUTPUT)%.o: %.c libapi_dirs
|
2013-02-20 22:32:30 +07:00
|
|
|
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
|
2013-12-09 23:14:23 +07:00
|
|
|
$(OUTPUT)%.s: %.c libapi_dirs
|
2013-02-20 22:32:30 +07:00
|
|
|
$(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
|
2013-12-09 23:14:23 +07:00
|
|
|
$(OUTPUT)%.o: %.S libapi_dirs
|
2013-02-20 22:32:30 +07:00
|
|
|
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
|
|
|
|
|
|
|
|
clean:
|
2013-12-09 23:14:23 +07:00
|
|
|
$(call QUIET_CLEAN, libapi) $(RM) $(LIB_OBJS) $(LIBFILE)
|
2013-02-20 22:32:30 +07:00
|
|
|
|
|
|
|
.PHONY: clean
|