mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Make use of implicit makefile rules and GCC's makefile generation so that header changes trigger rebuilds. Refactor common elements into Makefile.common.
This commit is contained in:
parent
35d8afc174
commit
f102a33bda
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -11,5 +11,8 @@
|
|||
*.la
|
||||
*.a
|
||||
|
||||
# Dependency makefiles
|
||||
*.d
|
||||
|
||||
#Compiled executable
|
||||
emulationstation
|
||||
|
|
21
Makefile
21
Makefile
|
@ -1,19 +1,4 @@
|
|||
CC=g++
|
||||
CFLAGS=-c -Wall -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/usr/include/freetype2 -I/usr/include/SDL -I/usr/include -D_RPI_
|
||||
LDFLAGS=-L/opt/vc/lib -lbcm_host -lEGL -lGLESv2 -lfreetype -lSDL -lboost_system -lboost_filesystem -lfreeimage -lSDL_mixer
|
||||
SRCSOURCES=main.cpp Renderer.cpp Renderer_init.cpp Font.cpp Renderer_draw_gl.cpp GuiComponent.cpp InputManager.cpp SystemData.cpp GameData.cpp FolderData.cpp XMLReader.cpp MathExp.cpp components/GuiGameList.cpp components/GuiInputConfig.cpp components/GuiImage.cpp components/GuiMenu.cpp components/GuiTheme.cpp components/GuiFastSelect.cpp components/GuiBox.cpp components/GuiAnimation.cpp AudioManager.cpp Sound.cpp pugiXML/pugixml.cpp
|
||||
SOURCES=$(addprefix src/,$(SRCSOURCES))
|
||||
OBJECTS=$(SOURCES:.cpp=.o)
|
||||
EXECUTABLE=emulationstation
|
||||
|
||||
all: $(SOURCES) $(EXECUTABLE)
|
||||
|
||||
$(EXECUTABLE): $(OBJECTS)
|
||||
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
|
||||
|
||||
.cpp.o:
|
||||
$(CC) $(CFLAGS) $< -o $@
|
||||
|
||||
clean:
|
||||
rm -rf src/*o src/components/*o $(EXECUTABLE)
|
||||
CPPFLAGS=-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/usr/include/freetype2 -I/usr/include/SDL -D_RPI_
|
||||
LIBS=-L/opt/vc/lib -lbcm_host -lEGL -lGLESv2 -lfreetype -lSDL -lboost_system -lboost_filesystem -lfreeimage -lSDL_mixer
|
||||
|
||||
include Makefile.common
|
||||
|
|
25
Makefile.common
Normal file
25
Makefile.common
Normal file
|
@ -0,0 +1,25 @@
|
|||
CXX=g++
|
||||
CXXFLAGS=-Wall -g -O2
|
||||
LDFLAGS=
|
||||
|
||||
SRC_SOURCES=AudioManager.cpp FolderData.cpp Font.cpp GameData.cpp GuiComponent.cpp InputManager.cpp main.cpp MathExp.cpp Renderer.cpp Renderer_draw_gl.cpp Renderer_init.cpp Sound.cpp SystemData.cpp XMLReader.cpp components/GuiAnimation.cpp components/GuiBox.cpp components/GuiFastSelect.cpp components/GuiGameList.cpp components/GuiImage.cpp components/GuiInputConfig.cpp components/GuiMenu.cpp components/GuiTheme.cpp pugiXML/pugixml.cpp
|
||||
SOURCES=$(addprefix src/,$(SRC_SOURCES))
|
||||
OBJECTS=$(SOURCES:.cpp=.o)
|
||||
DEPS=$(SOURCES:.cpp=.d)
|
||||
EXECUTABLE=emulationstation
|
||||
|
||||
all: $(EXECUTABLE)
|
||||
|
||||
$(EXECUTABLE): $(DEPS) $(OBJECTS)
|
||||
$(CXX) -o $@ $(LDFLAGS) $(OBJECTS) $(LIBS)
|
||||
|
||||
include $(wildcard src/*.d src/components/*.d src/pugiXML/*.d)
|
||||
|
||||
%.d: %.cpp
|
||||
$(SHELL) -ec '$(CXX) -M $(CPPFLAGS) $< | tr -d "\\\\\n" | sed -e "s|$(*F).o|$(*D)/& $@|" -e "s|: \(.*\)|: \$$\(wildcard \1\)|" > $@'
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
rm -f src/*.[do] src/components/*.[do] src/pugiXML/*.[do] $(EXECUTABLE)
|
||||
|
20
Makefile.x86
20
Makefile.x86
|
@ -1,18 +1,4 @@
|
|||
CC=g++
|
||||
CFLAGS=-c -Wall -I/usr/include/freetype2 -I/usr/include/SDL -I/usr/include -D_DESKTOP_ -g
|
||||
LDFLAGS=-lGL -lfreetype -lSDL -lboost_system -lboost_filesystem -lfreeimage -lSDL_mixer
|
||||
SRCSOURCES=main.cpp Renderer.cpp Renderer_init.cpp Font.cpp Renderer_draw_gl.cpp GuiComponent.cpp InputManager.cpp SystemData.cpp GameData.cpp FolderData.cpp XMLReader.cpp MathExp.cpp components/GuiGameList.cpp components/GuiInputConfig.cpp components/GuiImage.cpp components/GuiMenu.cpp components/GuiTheme.cpp components/GuiFastSelect.cpp components/GuiBox.cpp components/GuiAnimation.cpp Sound.cpp AudioManager.cpp pugiXML/pugixml.cpp
|
||||
SOURCES=$(addprefix src/,$(SRCSOURCES))
|
||||
OBJECTS=$(SOURCES:.cpp=.o)
|
||||
EXECUTABLE=emulationstation
|
||||
CPPFLAGS=-I/usr/include/freetype2 -I/usr/include/SDL -D_DESKTOP_
|
||||
LIBS=-lGL -lfreetype -lSDL -lboost_system -lboost_filesystem -lfreeimage -lSDL_mixer
|
||||
|
||||
all: $(SOURCES) $(EXECUTABLE)
|
||||
|
||||
$(EXECUTABLE): $(OBJECTS)
|
||||
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
|
||||
|
||||
.cpp.o:
|
||||
$(CC) $(CFLAGS) $< -o $@
|
||||
|
||||
clean:
|
||||
rm -rf src/*o src/components/*o $(EXECUTABLE)
|
||||
include Makefile.common
|
||||
|
|
Loading…
Reference in a new issue