<commit_before>
SERVER_PROG= wsProxyServer
SERVER_SRCS= proxyServerMain.cc proxyServerConn.cc

CLIENT_PROG= wsProxyClient
CLIENT_SRCS= proxyClientMain.cc proxyClientConn.cc proxyClientTcpAcceptor.cc

PROTOS= proxyMsgs.proto

#

OBJDIR= objs
PROGS= $(OBJDIR)/$(SERVER_PROG) $(OBJDIR)/$(CLIENT_PROG)
INCS= -I.. -I../../libpfkutil -I../../libpfkdll2 -I$(OBJDIR)

GENSRCS= $(PROTOS:%.proto=$(OBJDIR)/%.pb.cc)
GENHDRS= $(PROTOS:%.proto=$(OBJDIR)/%.pb.h)
GENOBJS= $(GENSRCS:.cc=.o)

SRCS= $(SERVER_SRCS) $(CLIENT_SRCS)
SERVER_OBJS= $(SERVER_SRCS:%.cc=$(OBJDIR)/%.o)
CLIENT_OBJS= $(CLIENT_SRCS:%.cc=$(OBJDIR)/%.o)

PFKLIBDIR= $(HOME)/pfk/$(PFKARCH)/lib

LIBS= -Wl,-rpath,$(PFKLIBDIR) -L$(PFKLIBDIR) \
	-lWebAppServer -lpfkutil -lprotobuf -lpthread 

CFLAGS= -O3

all: $(OBJDIR) $(OBJDIR)/xmakefile
	+make -f $(OBJDIR)/xmakefile $(PROGS)

$(OBJDIR):
	mkdir -p $(OBJDIR)

$(OBJDIR)/xmakefile: Makefile $(PROTOS) $(SRCS) $(GENSRCS)
	rm -f $(OBJDIR)/xmakefile $(OBJDIR)/x
	cat Makefile > $(OBJDIR)/x
	for f in $(SRCS) ; do \
		g++ -M $$f $(INCS) \
			-MT $(OBJDIR)/$${f%.cc}.o \
			-MF $(OBJDIR)/xdeps ; \
		cat $(OBJDIR)/xdeps >> $(OBJDIR)/x ; \
		rm -f $(OBJDIR)/xdeps ; \
	done
	for f in $(GENSRCS) ; do \
		g++ -M $$f $(INCS) \
			-MT $${f%.cc}.o \
			-MF $(OBJDIR)/xdeps ; \
		cat $(OBJDIR)/xdeps >> $(OBJDIR)/x ; \
		rm -f $(OBJDIR)/xdeps ; \
	done
	mv $(OBJDIR)/x $(OBJDIR)/xmakefile

$(GENSRCS): $(OBJDIR)/%.pb.cc: %.proto
	protoc --cpp_out=$(OBJDIR) $<

$(GENOBJS): %.o: %.cc
	g++ -c $(INCS) $< -o $@

$(SERVER_OBJS) $(CLIENT_OBJS): $(OBJDIR)/%.o: %.cc
	g++ -c $(INCS) $< -o $@

$(OBJDIR)/$(SERVER_PROG): $(SERVER_OBJS) $(GENOBJS)
	g++ $(SERVER_OBJS) $(GENOBJS) $(LIBS) -o $@

$(OBJDIR)/$(CLIENT_PROG): $(CLIENT_OBJS) $(GENOBJS)
	g++ $(CLIENT_OBJS) $(GENOBJS) $(LIBS) -o $@

install:
	cp $(PROGS) $(HOME)/pfk/$(PFKARCH)/bin

clean:
	rm -rf $(OBJDIR)<commit_msg>make the makefile fancier<commit_after>
SERVER_PROG= wsProxyServer
SERVER_SRCS= proxyServerMain.cc proxyServerConn.cc

CLIENT_PROG= wsProxyClient
CLIENT_SRCS= proxyClientMain.cc proxyClientConn.cc proxyClientTcpAcceptor.cc

PROTOS= proxyMsgs.proto

#

OBJDIR= objs
PROGS= $(OBJDIR)/$(SERVER_PROG) $(OBJDIR)/$(CLIENT_PROG)
INCS= -I.. -I../../libpfkutil -I../../libpfkdll2 -I$(OBJDIR)

GENSRCS= $(PROTOS:%.proto=$(OBJDIR)/%.pb.cc)
GENHDRS= $(PROTOS:%.proto=$(OBJDIR)/%.pb.h)
GENOBJS= $(GENSRCS:.cc=.o)

SRCS= $(SERVER_SRCS) $(CLIENT_SRCS)
SERVER_OBJS= $(SERVER_SRCS:%.cc=$(OBJDIR)/%.o)
CLIENT_OBJS= $(CLIENT_SRCS:%.cc=$(OBJDIR)/%.o)

PFKLIBDIR= $(HOME)/pfk/$(PFKARCH)/lib

LIBS= -Wl,-rpath,$(PFKLIBDIR) -L$(PFKLIBDIR) \
	-lWebAppServer -lpfkutil -lprotobuf -lpthread 

CFLAGS= -O3

ifeq ($(VERBOSE),)
Q=@
else
Q=
endif

all: $(OBJDIR) $(OBJDIR)/xmakefile
	$(Q)+make -f $(OBJDIR)/xmakefile $(PROGS)

$(OBJDIR):
	$(Q)echo making OBJDIR=$(OBJDIR)
	$(Q)mkdir -p $(OBJDIR)

$(OBJDIR)/xmakefile: Makefile $(PROTOS) $(SRCS) $(GENSRCS)
	$(Q)echo depending
	$(Q)rm -f $(OBJDIR)/xmakefile $(OBJDIR)/x
	$(Q)cat Makefile > $(OBJDIR)/x
	$(Q)($(foreach f,   $(SRCS),g++ -M $(f) $(INCS) \
		-MT $(OBJDIR)/$(f:.cc=.o);)) >> $(OBJDIR)/x
	$(Q)($(foreach f,$(GENSRCS),g++ -M $(f) $(INCS) \
		-MT           $(f:.cc=.o);)) >> $(OBJDIR)/x
	$(Q)mv $(OBJDIR)/x $(OBJDIR)/xmakefile

$(GENSRCS): $(OBJDIR)/%.pb.cc: %.proto
	$(Q)echo making protobuf c++
	$(Q)protoc --cpp_out=$(OBJDIR) $<

$(GENOBJS): %.o: %.cc
	$(Q)echo compiling $@
	$(Q)g++ -c $(INCS) $< -o $@

$(SERVER_OBJS) $(CLIENT_OBJS): $(OBJDIR)/%.o: %.cc
	$(Q)echo compiling $@
	$(Q)g++ -c $(INCS) $< -o $@

$(OBJDIR)/$(SERVER_PROG): $(GENOBJS) $(SERVER_OBJS)
	$(Q)echo linking $@
	$(Q)g++ $(SERVER_OBJS) $(GENOBJS) $(LIBS) -o $@

$(OBJDIR)/$(CLIENT_PROG): $(GENOBJS) $(CLIENT_OBJS)
	$(Q)echo linking $@
	$(Q)g++ $(CLIENT_OBJS) $(GENOBJS) $(LIBS) -o $@

install:
	cp $(PROGS) $(HOME)/pfk/$(PFKARCH)/bin

clean:
	$(Q)echo cleaning
	$(Q)rm -rf $(OBJDIR)
{'fraction_non_alphanumeric': 0.25507548152004167, 'fraction_numerical': 0.001041124414367517, 'mean_word_length': 4.389901823281908, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5381604', 'n_tokens_mistral': 1851, 'n_tokens_neox': 1732, 'n_words': 320}