Build parser check utility

This commit is contained in:
Emmanuel BENOîT 2017-11-06 10:33:18 +01:00
parent 77d46da19a
commit 0ed905bbde
3 changed files with 60 additions and 10 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
demo demo
parsercheck
*.o *.o
fd-*.h fd-*.h
imgui.ini imgui.ini

View file

@ -11,8 +11,8 @@ LIBS += $(shell sdl2-config --libs) -lGL -lGLEW -ldl \
FILEDUMPS = FILEDUMPS =
IMGUI = imgui.cpp imgui_draw.cpp IMGUI = imgui.cpp imgui_draw.cpp
DEMO = \
main.cc \ COMMON = \
imgui_impl_sdl.cc \ imgui_impl_sdl.cc \
\ \
utilities.cc \ utilities.cc \
@ -30,6 +30,10 @@ DEMO = \
sync.cc \ sync.cc \
control.cc \ control.cc \
opast.cc \ opast.cc \
# END COMMON
DEMO = \
main.cc \
\ \
demo.cc \ demo.cc \
\ \
@ -37,29 +41,52 @@ DEMO = \
bloom.cc \ bloom.cc \
dof.cc \ dof.cc \
combine.cc \ combine.cc \
fxaa.cc fxaa.cc \
# END DEMO
PARSERCHECK = \
parsercheck.cc \
# END PARSERCHECK
IMGUI_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(IMGUI)))) IMGUI_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(IMGUI))))
COMMON_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(COMMON))))
DEMO_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(DEMO)))) DEMO_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(DEMO))))
OBJS = $(IMGUI_OBJS) $(DEMO_OBJS) PARSERCHECK_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(PARSERCHECK))))
LIBEBCL = $(OUTDIR)/ebcl/libebcorelib.a LIBEBCL = $(OUTDIR)/ebcl/libebcorelib.a
PCH=externals.hh.gch PCH=externals.hh.gch
COMMON_DEPS = $(COMMON_OBJS:$(OUTDIR)/%.o=$(OUTDIR)/%.d)
DEMO_DEPS = $(DEMO_OBJS:$(OUTDIR)/%.o=$(OUTDIR)/%.d) DEMO_DEPS = $(DEMO_OBJS:$(OUTDIR)/%.o=$(OUTDIR)/%.d)
PARSERCHECK_DEPS = $(PARSERCHECK_OBJS:$(OUTDIR)/%.o=$(OUTDIR)/%.d)
demo: $(LIBEBCL) $(OBJS) COMMON_REQ = $(COMMON_OBJS) $(IMGUI_OBJS)
DEMO_BUILD = $(DEMO_OBJS) $(COMMON_REQ)
PARSERCHECK_BUILD = $(PARSERCHECK_OBJS) $(COMMON_REQ)
ALL_OBJS = $(DEMO_OBJS) $(PARSERCHECK_OBJS) $(COMMON_REQ)
ALL_DEPS = $(COMMON_DEPS) $(DEMO_DEPS) $(PARSERCHECK_DEPS)
all: demo parsercheck
demo: $(LIBEBCL) $(DEMO_BUILD)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o demo \ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o demo \
$(OBJS) $(LIBS) $(DEMO_BUILD) $(LIBS)
parsercheck: $(LIBEBCL) $(PARSERCHECK_BUILD)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o parsercheck \
$(PARSERCHECK_BUILD) $(LIBS)
clean: clean:
rm -f $(OBJS) $(FILEDUMPS) demo $(PCH) rm -f $(ALL_OBJS) $(FILEDUMPS) demo parsercheck $(PCH)
fullclean: clean fullclean: clean
@+make -C ebcl fullclean CONFIG=../ebcl-config @+make -C ebcl fullclean CONFIG=../ebcl-config
rm -f $(DEMO_DEPS) rm -f $(ALL_DEPS)
.PHONY: clean fullclean .PHONY: all clean fullclean
$(FILEDUMPS): fd-%.h: % $(FILEDUMPS): fd-%.h: %
@ -70,15 +97,34 @@ outdir:
@if ! [ -d "$(OUTDIR)" ]; then mkdir "$(OUTDIR)"; fi @if ! [ -d "$(OUTDIR)" ]; then mkdir "$(OUTDIR)"; fi
.PHONY: outdir .PHONY: outdir
#-------------------------------------------------------------------------------
$(IMGUI_OBJS): $(OUTDIR)/%.o: imgui/%.cpp | outdir $(IMGUI_OBJS): $(OUTDIR)/%.o: imgui/%.cpp | outdir
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
-include $(DEMO_DEPS) #-------------------------------------------------------------------------------
-include $(DEMO_DEPS)
$(DEMO_OBJS): $(OUTDIR)/%.o: %.cc $(PCH) | outdir $(FILEDUMPS) $(DEMO_OBJS): $(OUTDIR)/%.o: %.cc $(PCH) | outdir $(FILEDUMPS)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -M -MF $(@:%.o=%.d) -MT $@ $< $(CXX) $(CXXFLAGS) $(CPPFLAGS) -M -MF $(@:%.o=%.d) -MT $@ $<
#-------------------------------------------------------------------------------
-include $(COMMON_DEPS)
$(COMMON_OBJS): $(OUTDIR)/%.o: %.cc $(PCH) | outdir $(FILEDUMPS)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -M -MF $(@:%.o=%.d) -MT $@ $<
#-------------------------------------------------------------------------------
-include $(PARSERCHECK_DEPS)
$(PARSERCHECK_OBJS): $(OUTDIR)/%.o: %.cc $(PCH) | outdir $(FILEDUMPS)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -M -MF $(@:%.o=%.d) -MT $@ $<
#-------------------------------------------------------------------------------
$(LIBEBCL): ebcl-config $(LIBEBCL): ebcl-config
+make -C ebcl CONFIG=../ebcl-config +make -C ebcl CONFIG=../ebcl-config

3
parsercheck.cc Normal file
View file

@ -0,0 +1,3 @@
int main( )
{
}