Commit 682405a0 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Fixes #1580. logformat now only runs once.

git-svn-id: file:///svn/toku/tokudb@10417 c7de825b-a66e-492c-adef-691d508d4ae1
parent 426f0871
...@@ -92,8 +92,17 @@ $(IPO_NEWBRT): ipo_newbrt.obj ...@@ -92,8 +92,17 @@ $(IPO_NEWBRT): ipo_newbrt.obj
xilib /out:$@ $^ xilib /out:$@ $^
log_code.$(OEXT): log_header.h wbuf.h log-internal.h rbuf.h log_code.$(OEXT): log_header.h wbuf.h log-internal.h rbuf.h
log_header.h log_code.c: logformat$(BINSUF)
# This version runs logformat twice. There is something screwing in make that if you have a pattern form with two outputs
# then it runs the thing only once, but if it has no % symbols it runs it twice.
## log_header.h log_code.c: logformat$(BINSUF)
## ./logformat
# So we do it this way
log_code.c: logformat$(BINSUF)
./logformat ./logformat
log_header.h: log_code.c
test 1 = 1
#Needs to be done manually since it does not include newbrt. #Needs to be done manually since it does not include newbrt.
logformat$(BINSUF): logformat.c $(LIBPORTABILITY) logformat$(BINSUF): logformat.c $(LIBPORTABILITY)
$(CC) $< $(BIN_FROM_O_FLAGS_NOLIB) $(LIBPORTABILITY) $(LINK_MUST_BE_LAST) $(CC) $< $(BIN_FROM_O_FLAGS_NOLIB) $(LIBPORTABILITY) $(LINK_MUST_BE_LAST)
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "toku_portability.h" #include "toku_portability.h"
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -20,6 +21,7 @@ ...@@ -20,6 +21,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
typedef struct field { typedef struct field {
char *type; char *type;
char *name; char *name;
...@@ -498,7 +500,9 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__u ...@@ -498,7 +500,9 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__u
chmod(headerpath, S_IRUSR|S_IWUSR); chmod(headerpath, S_IRUSR|S_IWUSR);
unlink(codepath); unlink(codepath);
unlink(headerpath); unlink(headerpath);
cf = fopen(codepath, "w"); assert(cf!=0); cf = fopen(codepath, "w");
if (cf==0) { int r = errno; printf("fopen of %s failed because of errno=%d (%s)\n", codepath, r, strerror(r)); } // sometimes this is failing, so let's make a better diagnostic
assert(cf!=0);
hf = fopen(headerpath, "w"); assert(hf!=0); hf = fopen(headerpath, "w"); assert(hf!=0);
fprintf(hf, "#ifndef LOG_HEADER_H\n"); fprintf(hf, "#ifndef LOG_HEADER_H\n");
fprintf(hf, "#define LOG_HEADER_H\n"); fprintf(hf, "#define LOG_HEADER_H\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment