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