From: Andy Belle-Isle Date: Tue, 27 Aug 2019 03:11:30 +0000 (-0400) Subject: Fixed Makefile to be fully recursive X-Git-Tag: v0.1-alpha~31 X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=6acad98c1dba2c07045ae724da1f833ee8369d47;p=clyne%2Fgamedev2.git Fixed Makefile to be fully recursive --- 6acad98c1dba2c07045ae724da1f833ee8369d47 diff --cc Makefile index b498fdd,d6a3d32..6d6d404 --- a/Makefile +++ b/Makefile @@@ -3,6 -3,6 +3,7 @@@ # Script to build source files # # Copyright (C) 2019 Clyne Sullivan ++# Copyright (C) 2019 Andy Belle-Isle # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@@ -11,45 -11,45 +12,67 @@@ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of --# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License --# along with this program. If not, see . ++# along with this program. If not, see . ++# ++ ++# ++# VARIABLES # CC = gcc CXX = g++ ++EXEC = main ++EXECDIR = . ++ ++SRCDIR = src ++OUTDIR = out ++SRCEXT = cpp ++OBJEXT = o ++DEPEXT = d ++ LIBDIR = lib --LIBS = -L$(LIBDIR) -lSDL2 -lpthread -lentityx -lluajit ++LIBS = -L$(LIBDIR) -lSDL2 -lpthread -lentityx -ldl -lluajit --CXXFLAGS = -ggdb -std=c++17 \ -- -Wall -Wextra -Werror -pedantic \ - -Isrc -I$(LIBDIR)/LuaJIT -I$(LIBDIR)/entityx/entityx -I$(LIBDIR)/entityx - -Isrc -I$(LIBDIR)/LuaJIT/src -I$(LIBDIR)/entityx ++CXXFLAGS = -ggdb -std=c++17 -Wall -Wextra -Werror -pedantic --CXXSRCDIR = src --CXXOUTDIR = out --CXXSRC = $(wildcard $(CXXSRCDIR)/*.cpp) $(wildcard $(CXXSRCDIR)/*/*.cpp) --CXXOBJ = $(patsubst $(CXXSRCDIR)/%.cpp, $(CXXOUTDIR)/%.o, $(CXXSRC)) ++CXXINCS = -Isrc -I$(LIBDIR)/LuaJIT/src -I$(LIBDIR)/entityx --EXEC = main ++CXXSRC := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT)) ++CXXOBJ := $(patsubst $(SRCDIR)/%,$(OUTDIR)/%,$(CXXSRC:.$(SRCEXT)=.$(OBJEXT))) ++ ++# ++# COMPILE STUFF ++# ++ ++all: resources $(EXEC) ++ ++resources: directories --all: $(EXEC) ++directories: ++ @mkdir -p $(EXECDIR) ++ @mkdir -p $(OUTDIR) clean: -- @echo " CLEAN" -- @rm -f $(EXEC) -- @rm -rf out ++ @$(RM) -rf $(OUTDIR) --$(EXEC): $(CXXOUTDIR) $(CXXOUTDIR)/$(CXXOBJ) -- @echo " CXX/LD main" -- @$(CXX) $(CXXFLAGS) -o $(EXEC) $(CXXOBJ) $(LIBS) ++cleaner: clean ++ @$(RM) -rf $(EXECDIR) --$(CXXOUTDIR)/%.o: $(CXXSRCDIR)/%.cpp -- @echo " CXX " $< -- @$(CXX) $(CXXFLAGS) -c $< -o $@ ++$(EXEC): $(CXXOBJ) ++ $(CXX) -o $(EXECDIR)/$(EXEC) $^ $(LIBS) --$(CXXOUTDIR): -- @mkdir $(CXXOUTDIR) ++$(OUTDIR)/%.$(OBJEXT): $(SRCDIR)/%.$(SRCEXT) ++ @mkdir -p $(dir $@) ++ $(CXX) $(CXXFLAGS) $(CXXINCS) -c -o $@ $< ++ @$(CXX) $(CXXFLAGS) $(INCDEP) -MM $(SRCDIR)/$*.$(SRCEXT) > $(OUTDIR)/$*.$(DEPEXT) ++ @cp -f $(OUTDIR)/$*.$(DEPEXT) $(OUTDIR)/$*.$(DEPEXT).tmp ++ @sed -e 's|.*:|$(OUTDIR)/$*.$(OBJEXT):|' < $(OUTDIR)/$*.$(DEPEXT).tmp > $(OUTDIR)/$*.$(DEPEXT) ++ @sed -e 's/.*://' -e 's/\\$$//' < $(OUTDIR)/$*.$(DEPEXT).tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $(OUTDIR)/$*.$(DEPEXT) ++ @rm -f $(OUTDIR)/$*.$(DEPEXT).tmp ++.PHONY: all remake clean cleaner resources diff --cc lib/libluajit.a index 76c6fbe,76c6fbe..c82e81c Binary files differ diff --cc src/Script/entityx/entity_lua.cpp index e62f040,0000000..b23628b mode 100644,000000..100644 --- a/src/Script/entityx/entity_lua.cpp +++ b/src/Script/entityx/entity_lua.cpp @@@ -1,181 -1,0 +1,183 @@@ - #include "entityx_lua.h" ++//#include "entityx_lua.h" ++#include