Makefile 724 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. TARGET = proxy2ch
  2. SOURCES = main.cpp BBS2chProxyConnection.cpp BBS2chProxyAuth.cpp DataStorage.cpp hmac.c
  3. OBJS = $(SOURCES:.cpp=.o)
  4. OBJS := $(OBJS:.c=.o)
  5. CFLAGS = -O2
  6. LDFLAGS = -lcurl -lpthread
  7. UNAME := $(shell uname)
  8. HAVE_GNUTLS := $(shell pkg-config --libs gnutls 2>&1 >/dev/null; echo $$?)
  9. ifneq ($(UNAME), Darwin)
  10. ifeq ($(HAVE_GNUTLS), 0)
  11. CFLAGS += -DUSE_GNUTLS
  12. LDFLAGS += -lgnutls
  13. else
  14. LDFLAGS += -lcrypto
  15. endif
  16. endif
  17. .PHONY: all
  18. all : $(TARGET)
  19. $(TARGET) : $(OBJS)
  20. $(CXX) $^ -o $(TARGET) $(LDFLAGS)
  21. .cpp.o:
  22. $(CXX) $(CFLAGS) -c $<
  23. .c.o:
  24. $(CC) $(CFLAGS) -c $<
  25. .PHONY: depend
  26. depend:
  27. $(CXX) -MM $(CFLAGS) $(SOURCES) > dependencies
  28. .PHONY: clean
  29. clean :
  30. rm -f $(OBJS) $(TARGET)
  31. include dependencies