Closed Fulguritude closed 3 years ago
I answered my own question, the fix was simply to add appropriate schema.o
lines to the Makefile. My code below:
CC=gcc
MAKEDIR=@mkdir -p $(@D)
BUILDDIR=unix/release
#CFLAGS=-c -Wall -DWJE_DISTINGUISH_INTEGER_TYPE -O3 -Iinclude
CFLAGS=-c -Wall -DWJE_DISTINGUISH_INTEGER_TYPE -g -DDEBUG -Iinclude
all: $(BUILDDIR)/libwjelement.a
$(BUILDDIR)/libwjelement.a: $(BUILDDIR)/xpl.o $(BUILDDIR)/element.o $(BUILDDIR)/schema.o $(BUILDDIR)/hash.o $(BUILDDIR)/search.o $(BUILDDIR)/types.o $(BUILDDIR)/wjreader.o $(BUILDDIR)/wjwriter.o
$(MAKEDIR)
ar rvs $@ $(BUILDDIR)/xpl.o $(BUILDDIR)/element.o $(BUILDDIR)/schema.o $(BUILDDIR)/hash.o $(BUILDDIR)/search.o $(BUILDDIR)/types.o $(BUILDDIR)/wjreader.o $(BUILDDIR)/wjwriter.o
$(BUILDDIR)/xpl.o: src/lib/xpl.c
$(MAKEDIR)
$(CC) $(CFLAGS) $< -o $@
$(BUILDDIR)/element.o: src/wjelement/element.c
$(MAKEDIR)
$(CC) $(CFLAGS) $< -o $@
$(BUILDDIR)/schema.o: src/wjelement/schema.c
$(MAKEDIR)
$(CC) $(CFLAGS) $< -o $@
$(BUILDDIR)/hash.o: src/wjelement/hash.c
$(MAKEDIR)
$(CC) $(CFLAGS) $< -o $@
$(BUILDDIR)/search.o: src/wjelement/search.c
$(MAKEDIR)
$(CC) $(CFLAGS) $< -o $@
$(BUILDDIR)/types.o: src/wjelement/types.c
$(MAKEDIR)
$(CC) $(CFLAGS) $< -o $@
$(BUILDDIR)/wjreader.o: src/wjreader/wjreader.c
$(MAKEDIR)
$(CC) $(CFLAGS) $< -o $@
$(BUILDDIR)/wjwriter.o: src/wjwriter/wjwriter.c
$(MAKEDIR)
$(CC) $(CFLAGS) $< -o $@
clean:
rm $(BUILDDIR)/*
Should I do a pull request ? Or is schema.o
voluntarily kept out of the build ?
Should I do a pull request where I make your Makefile more modular ? (it repeats itself a lot and would greatly improve by removing boilerplate)
Hey @Fulguritude , glad you found a solution! I would be happy to see a pull request. The repetition and boilerplate you're talking about, is that referring to the Makefiles that CMake generates, or our CMakeLists.txt files? (I ask because only the latter are part of the actual source tree. Either way I'm sure our makefiles are quite crufty and would welcome some attention :^)
Hey @penduin
The file I copied and edited in particular is the Makefile-all
at the top-level (which I had renamed Makefile
to run with make
; I had never used cmake
in my life until today, which I did to try to understand what you were talking about xd).
Makefile-all
doesn't seem to be a cmake-generated Makefile, but rather something that was used for old builds and then forgotten...
Being a "raw Makefile" adept is probably why I landed on this issue.
If you'd like, I'll turn Makefile-all
into a more "standard" Makefile, which respects your file structure (ie, not going through each CMakeLists.txt, but rather be a standalone that builds for your platform when you call make
). If, on your end, you can compile a lib with just "make" from a raw repo clone, my job'll be successful, essentially.
Oh! Indeed I had forgotten all about Makefile-all -- you're exactly right. :^) Yes, I'd welcome an update to that; it predates wjeschema entirely! Being able to "make -f Makefile-all" will be great to have for anyone who doesn't wish to bother with CMake.
On 5/28/20, Fulguritude notifications@github.com wrote:
Hey @penduin
The file I copied and edited in particular is the
Makefile-all
at the top-level (which I had renamedMakefile
to run withmake
; I had never usedcmake
in my life until today, which I did to try to understand what you were talking about xd).
Makefile-all
doesn't seem to be a cmake-generated Makefile, but rather something that was used for old builds and then forgotten... Being a "raw Makefile" adept is probably why I landed on this issue.If you'd like, I'll turn
Makefile-all
into a more "standard" Makefile, which respects your file structure (ie, not going through each CMakeLists.txt, but rather be a standalone that builds for your platform when you callmake
). If, on your end, you can compile a lib with just "make" from a raw repo clone, my job'll be successful, essentially.-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/netmail-open/wjelement/issues/90#issuecomment-635581790
I'm getting an "undefined symbol" error for WJESchemaValidate when linking the wjelement library (built from source on Mac OS X). The rest of the library (that I've used) works fine (thanks, btw!).
Here is the result of
nm
on the build, you can see that WJESchemaValidate is indeed absent:Is there an easy fix that I am missing, or is this indeed a build error ?