Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 1 | include ../../scripts/Makefile.include |
| 2 | |
Rabin Vincent | 3c4797d | 2013-05-17 22:27:44 +0200 | [diff] [blame] | 3 | CC = $(CROSS_COMPILE)gcc |
| 4 | AR = $(CROSS_COMPILE)ar |
| 5 | |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 6 | # guard against environment variables |
| 7 | LIB_H= |
| 8 | LIB_OBJS= |
| 9 | |
| 10 | LIB_H += debugfs.h |
| 11 | |
| 12 | LIB_OBJS += $(OUTPUT)debugfs.o |
| 13 | |
| 14 | LIBFILE = liblk.a |
| 15 | |
Borislav Petkov | b28b130 | 2013-03-03 20:25:33 +0100 | [diff] [blame] | 16 | 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] | 17 | EXTLIBS = -lelf -lpthread -lrt -lm |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 18 | ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 |
| 19 | ALL_LDFLAGS = $(LDFLAGS) |
| 20 | |
| 21 | RM = rm -f |
| 22 | |
| 23 | $(LIBFILE): $(LIB_OBJS) |
| 24 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $(OUTPUT)$@ $(LIB_OBJS) |
| 25 | |
| 26 | $(LIB_OBJS): $(LIB_H) |
| 27 | |
| 28 | $(OUTPUT)%.o: %.c |
| 29 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< |
| 30 | $(OUTPUT)%.s: %.c |
| 31 | $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $< |
| 32 | $(OUTPUT)%.o: %.S |
| 33 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< |
| 34 | |
| 35 | clean: |
| 36 | $(RM) $(LIB_OBJS) $(LIBFILE) |
| 37 | |
| 38 | .PHONY: clean |