Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. include ../../scripts/Makefile.include
  2. include ../../scripts/utilities.mak # QUIET_CLEAN
  3. ifeq ($(srctree),)
  4. srctree := $(patsubst %/,%,$(dir $(shell pwd)))
  5. srctree := $(patsubst %/,%,$(dir $(srctree)))
  6. srctree := $(patsubst %/,%,$(dir $(srctree)))
  7. #$(info Determined 'srctree' to be $(srctree))
  8. endif
  9. CC = $(CROSS_COMPILE)gcc
  10. AR = $(CROSS_COMPILE)ar
  11. LD = $(CROSS_COMPILE)ld
  12. MAKEFLAGS += --no-print-directory
  13. LIBFILE = $(OUTPUT)libapi.a
  14. CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
  15. CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC
  16. CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
  17. CFLAGS += -I$(srctree)/tools/lib/api
  18. RM = rm -f
  19. API_IN := $(OUTPUT)libapi-in.o
  20. all:
  21. export srctree OUTPUT CC LD CFLAGS V
  22. include $(srctree)/tools/build/Makefile.include
  23. all: fixdep $(LIBFILE)
  24. $(API_IN): FORCE
  25. @$(MAKE) $(build)=libapi
  26. $(LIBFILE): $(API_IN)
  27. $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(API_IN)
  28. clean:
  29. $(call QUIET_CLEAN, libapi) $(RM) $(LIBFILE); \
  30. find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM)
  31. FORCE:
  32. .PHONY: clean FORCE