commit eb4c59c909e4beebd2e0bcff1eefe08178bdcff1 parent 67ce467083cf5391bc59fe9e10aa2ade74e30ea6 Author: Michael Savage <mikejsavage@gmail.com> Date: Sat Sep 10 18:03:16 -0700 Compile stb headers directly instead of making intermediate .cc files Diffstat:
rules.mk | | | 8 | ++------ |
diff --git a/rules.mk b/rules.mk @@ -7,17 +7,13 @@ $(BINS): %: # Create stb_*.cc and then stb_*.o STB_OBJS := $(addprefix stb_,$(addsuffix .o,$(STBS))) -STB_CCS := $(addprefix stb_,$(addsuffix .cc,$(STBS))) - -$(STB_CCS): %.cc: %.h - cp $^ $*.cc # The STB libraries need you to pass -DSTB_*_IMPLEMENTATION to get the actual code STB_CXXFLAGS := $(shell echo $(addprefix -DSTB_,$(addsuffix _IMPLEMENTATION,$(STBS))) | tr a-z A-Z) STB_CXXFLAGS += -Wno-misleading-indentation -$(STB_OBJS): %.o: %.cc - $(CXX) -c -o $@ $*.cc $(CXXFLAGS) $(STB_CXXFLAGS) +$(STB_OBJS): %.o: %.h + $(CXX) -x c++ -c -o $@ $< $(CXXFLAGS) $(STB_CXXFLAGS) # Build the game modules $(MODULES): %.so: $(COMMON_OBJS)