blob: 3dba0a4aebbf5b36ac0f24638eaf557d28b15170 [file] [log] [blame]
Borislav Petkov85c66be2013-02-20 16:32:30 +01001include ../../scripts/Makefile.include
2
Rabin Vincent3c4797d2013-05-17 22:27:44 +02003CC = $(CROSS_COMPILE)gcc
4AR = $(CROSS_COMPILE)ar
5
Borislav Petkov85c66be2013-02-20 16:32:30 +01006# guard against environment variables
7LIB_H=
8LIB_OBJS=
9
10LIB_H += debugfs.h
11
12LIB_OBJS += $(OUTPUT)debugfs.o
13
14LIBFILE = liblk.a
15
Borislav Petkovb28b1302013-03-03 20:25:33 +010016CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC
Mike Frysingerd14c4962013-05-09 00:17:44 -040017EXTLIBS = -lelf -lpthread -lrt -lm
Borislav Petkov85c66be2013-02-20 16:32:30 +010018ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
19ALL_LDFLAGS = $(LDFLAGS)
20
21RM = 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
35clean:
36 $(RM) $(LIB_OBJS) $(LIBFILE)
37
38.PHONY: clean