1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- TARGET = proxy2ch
- SOURCES = main.cpp BBS2chProxyConnection.cpp BBS2chProxyAuth.cpp hmac.c stringEncodingConverter.c BBS2chProxyRawSocket.cpp BBS2chProxySecureSocket.cpp BBS2chProxyHttpHeaders.cpp BBS2chProxyURL.cpp BBS2chProxyKeyManager.cpp BBS2chProxyBoardManager.cpp BBS2chProxyHTML2Dat.cpp BBS2chProxyFormData.cpp BBS2chProxyPoster.cpp parson/parson.c
- OBJS = $(SOURCES:.cpp=.o)
- OBJS := $(OBJS:.c=.o)
- CFLAGS = -O2
- LDFLAGS = -lcurl -lpthread
- UNAME := $(shell uname)
- HAVE_GNUTLS := $(shell pkg-config --libs gnutls >/dev/null 2>&1; echo $$?)
- NOT_GLIBC := $(shell $(CC) -E -dM stringEncodingConverter.c | grep __GNU_LIBRARY__; echo $$?)
- ifneq ($(UNAME), Darwin)
- ifeq ($(NOT_GLIBC), 1)
- LDFLAGS += -liconv
- endif
- ifeq ($(HAVE_GNUTLS), 0)
- CFLAGS += -DUSE_GNUTLS
- LDFLAGS += -lgnutls
- else
- LDFLAGS += -lcrypto
- endif
- else
- LDFLAGS += -framework CoreFoundation
- endif
- .PHONY: all
- all : $(TARGET)
- $(TARGET) : $(OBJS)
- $(CXX) $^ -o $(TARGET) $(LDFLAGS)
- .cpp.o:
- $(CXX) $(CFLAGS) -c -o $@ $<
- .c.o:
- $(CC) $(CFLAGS) -c -o $@ $<
- .PHONY: depend
- depend:
- $(CXX) -MM $(CFLAGS) $(SOURCES) > dependencies
- .PHONY: clean
- clean :
- rm -f $(OBJS) $(TARGET)
- include dependencies
|