Makefile 668 B

123456789101112131415161718192021
  1. P_NAME := libclibutils.a
  2. P_C_SRCS := $(wildcard *.c)
  3. P_C_OBJS := ${P_C_SRCS:.c=.o}
  4. P_OBJS := $(P_C_OBJS)
  5. P_INCLUDE_DIRS := ../inc
  6. CPPFLAGS += $(foreach includedir,$(P_INCLUDE_DIRS),-I$(includedir))
  7. LDFLAGS += $(foreach librarydir,$(P_LIBRARY_DIRS),-L$(librarydir))
  8. LDFLAGS += $(foreach library,$(P_LIBRARIES),-l$(library))
  9. CXX := gcc
  10. CC := gcc -g -Wall -Wextra -Wparentheses -pedantic
  11. .PHONY: all clean
  12. all: $(P_NAME)
  13. $(P_NAME): $(P_OBJS)
  14. ar rcs $(P_NAME) $(P_OBJS)
  15. clean:
  16. @- $(RM) $(P_NAME)
  17. @- $(RM) $(P_OBJS)
  18. @- $(RM) core*
  19. @- $(RM) tags