From 0ed905bbdec426e71e6db6e06702393b246ad6fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Mon, 6 Nov 2017 10:33:18 +0100 Subject: [PATCH] Build parser check utility --- .gitignore | 1 + Makefile | 66 ++++++++++++++++++++++++++++++++++++++++++-------- parsercheck.cc | 3 +++ 3 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 parsercheck.cc diff --git a/.gitignore b/.gitignore index ffb88be..ca7106d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ demo +parsercheck *.o fd-*.h imgui.ini diff --git a/Makefile b/Makefile index d41e530..1980fd7 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,8 @@ LIBS += $(shell sdl2-config --libs) -lGL -lGLEW -ldl \ FILEDUMPS = IMGUI = imgui.cpp imgui_draw.cpp -DEMO = \ - main.cc \ + +COMMON = \ imgui_impl_sdl.cc \ \ utilities.cc \ @@ -30,6 +30,10 @@ DEMO = \ sync.cc \ control.cc \ opast.cc \ +# END COMMON + +DEMO = \ + main.cc \ \ demo.cc \ \ @@ -37,29 +41,52 @@ DEMO = \ bloom.cc \ dof.cc \ combine.cc \ - fxaa.cc + fxaa.cc \ +# END DEMO + +PARSERCHECK = \ + parsercheck.cc \ +# END PARSERCHECK IMGUI_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(IMGUI)))) +COMMON_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(COMMON)))) 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 PCH=externals.hh.gch +COMMON_DEPS = $(COMMON_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 \ - $(OBJS) $(LIBS) + $(DEMO_BUILD) $(LIBS) + +parsercheck: $(LIBEBCL) $(PARSERCHECK_BUILD) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o parsercheck \ + $(PARSERCHECK_BUILD) $(LIBS) clean: - rm -f $(OBJS) $(FILEDUMPS) demo $(PCH) + rm -f $(ALL_OBJS) $(FILEDUMPS) demo parsercheck $(PCH) fullclean: clean @+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: % @@ -70,15 +97,34 @@ outdir: @if ! [ -d "$(OUTDIR)" ]; then mkdir "$(OUTDIR)"; fi .PHONY: outdir +#------------------------------------------------------------------------------- + $(IMGUI_OBJS): $(OUTDIR)/%.o: imgui/%.cpp | outdir $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< --include $(DEMO_DEPS) +#------------------------------------------------------------------------------- +-include $(DEMO_DEPS) $(DEMO_OBJS): $(OUTDIR)/%.o: %.cc $(PCH) | outdir $(FILEDUMPS) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< $(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 +make -C ebcl CONFIG=../ebcl-config diff --git a/parsercheck.cc b/parsercheck.cc new file mode 100644 index 0000000..387c9aa --- /dev/null +++ b/parsercheck.cc @@ -0,0 +1,3 @@ +int main( ) +{ +}