Makefile 893 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. TARGET = proxy2ch
  2. SOURCES = main.cpp BBS2chProxyConnection.cpp BBS2chProxyAuth.cpp DataStorage.cpp hmac.c stringEncodingConverter.c BBS2chProxyRawSocket.cpp BBS2chProxySecureSocket.cpp BBS2chProxyHttpHeaders.cpp
  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 >/dev/null 2>&1; echo $$?)
  9. ifneq ($(UNAME), Darwin)
  10. LDFLAGS += -liconv
  11. ifeq ($(HAVE_GNUTLS), 0)
  12. CFLAGS += -DUSE_GNUTLS
  13. LDFLAGS += -lgnutls
  14. else
  15. LDFLAGS += -lcrypto
  16. endif
  17. else
  18. LDFLAGS += -framework CoreFoundation
  19. endif
  20. .PHONY: all
  21. all : $(TARGET)
  22. $(TARGET) : $(OBJS)
  23. $(CXX) $^ -o $(TARGET) $(LDFLAGS)
  24. .cpp.o:
  25. $(CXX) $(CFLAGS) -c $<
  26. .c.o:
  27. $(CC) $(CFLAGS) -c $<
  28. .PHONY: depend
  29. depend:
  30. $(CXX) -MM $(CFLAGS) $(SOURCES) > dependencies
  31. .PHONY: clean
  32. clean :
  33. rm -f $(OBJS) $(TARGET)
  34. include dependencies