Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 1 | include ../../scripts/Makefile.include |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 2 | include ../../perf/config/utilities.mak # QUIET_CLEAN |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 3 | |
Rabin Vincent | 3c4797d | 2013-05-17 22:27:44 +0200 | [diff] [blame] | 4 | CC = $(CROSS_COMPILE)gcc |
| 5 | AR = $(CROSS_COMPILE)ar |
| 6 | |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 7 | # guard against environment variables |
| 8 | LIB_H= |
| 9 | LIB_OBJS= |
| 10 | |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 11 | LIB_H += fs/debugfs.h |
Steven Rostedt (Red Hat) | cde164a | 2015-02-02 14:35:03 -0500 | [diff] [blame^] | 12 | LIB_H += fs/findfs.h |
Borislav Petkov | cd0cfad | 2013-12-09 17:14:24 +0100 | [diff] [blame] | 13 | LIB_H += fs/fs.h |
Arnaldo Carvalho de Melo | 1b85337 | 2014-09-03 18:02:59 -0300 | [diff] [blame] | 14 | # See comment below about piggybacking... |
| 15 | LIB_H += fd/array.h |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 16 | |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 17 | LIB_OBJS += $(OUTPUT)fs/debugfs.o |
Steven Rostedt (Red Hat) | cde164a | 2015-02-02 14:35:03 -0500 | [diff] [blame^] | 18 | LIB_OBJS += $(OUTPUT)fs/findfs.o |
Borislav Petkov | cd0cfad | 2013-12-09 17:14:24 +0100 | [diff] [blame] | 19 | LIB_OBJS += $(OUTPUT)fs/fs.o |
Arnaldo Carvalho de Melo | 1b85337 | 2014-09-03 18:02:59 -0300 | [diff] [blame] | 20 | # XXX piggybacking here, need to introduce libapikfd, or rename this |
| 21 | # to plain libapik.a and make it have it all api goodies |
| 22 | LIB_OBJS += $(OUTPUT)fd/array.o |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 23 | |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 24 | LIBFILE = libapikfs.a |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 25 | |
Borislav Petkov | b28b130 | 2013-03-03 20:25:33 +0100 | [diff] [blame] | 26 | CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC |
Mike Frysinger | d14c496 | 2013-05-09 00:17:44 -0400 | [diff] [blame] | 27 | EXTLIBS = -lelf -lpthread -lrt -lm |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 28 | ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 |
| 29 | ALL_LDFLAGS = $(LDFLAGS) |
| 30 | |
| 31 | RM = rm -f |
| 32 | |
| 33 | $(LIBFILE): $(LIB_OBJS) |
| 34 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $(OUTPUT)$@ $(LIB_OBJS) |
| 35 | |
| 36 | $(LIB_OBJS): $(LIB_H) |
| 37 | |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 38 | libapi_dirs: |
Arnaldo Carvalho de Melo | 1b85337 | 2014-09-03 18:02:59 -0300 | [diff] [blame] | 39 | $(QUIET_MKDIR)mkdir -p $(OUTPUT)fd $(OUTPUT)fs |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 40 | |
| 41 | $(OUTPUT)%.o: %.c libapi_dirs |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 42 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 43 | $(OUTPUT)%.s: %.c libapi_dirs |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 44 | $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $< |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 45 | $(OUTPUT)%.o: %.S libapi_dirs |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 46 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< |
| 47 | |
| 48 | clean: |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 49 | $(call QUIET_CLEAN, libapi) $(RM) $(LIB_OBJS) $(LIBFILE) |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 50 | |
| 51 | .PHONY: clean |