12345678910111213141516171819202122232425262728293031323334 |
- CC = cc
- LINK = ld -o
- CROSS := $(TARGET)
- MKDEP = $(CROSS)$(CC) -M -o $*.d $<
-
- LIBRARY_LINK_OPTS = -L. -r
- CFLAGS = -O2 -ggdb -std=c99 -D_GNU_SOURCE
- CFLAGS += -Wall -Wextra -Wshadow -Wformat-security -Wstrict-prototypes
- RM = /bin/rm -f
- Q=@
-
- OBJS = queue.o list.o cbuf.o io.o log.o http_response.o asyncdns.o \
- server.o misc.o
-
- PROG = libfuncs.a
-
- all: $(PROG)
-
- $(PROG): $(OBJS)
- $(Q)echo " LINK $(PROG)"
- $(Q)$(CROSS)$(LINK) $@ $(LIBRARY_LINK_OPTS) $(OBJS)
-
- %.o: %.c libfuncs.h
- @$(MKDEP)
- $(Q)echo " CC libfuncs $<"
- $(Q)$(CROSS)$(CC) $(CFLAGS) -c $<
-
- -include $(OBJS:.o=.d)
-
- clean:
- $(Q)echo " RM $(PROG) $(OBJS:.o=.o) $(OBJS:.o=.d)"
- $(Q)$(RM) $(PROG) $(OBJS:.o=.o) $(OBJS:.o=.d) *~
-
- distclean: clean
|