-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e06f26d
commit cad7d4e
Showing
26 changed files
with
99 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule .makefile
updated
59 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,41 @@ | ||
|
||
################################################### | ||
# Project definition | ||
# | ||
PROJECT = OpenGlassBox | ||
TARGET = $(PROJECT) | ||
DESCRIPTION = An Open Source Implementation of the SimCity 2013 Simulation Engine GlassBox | ||
STANDARD = --std=c++14 | ||
BUILD_TYPE = release | ||
|
||
################################################### | ||
# Location of the project directory and Makefiles | ||
# | ||
P := . | ||
M := $(P)/.makefile | ||
include $(M)/Makefile.header | ||
|
||
################################################### | ||
# Inform Makefile where to find header files | ||
# | ||
INCLUDES += -I$(P)/include -I$(P) | ||
|
||
################################################### | ||
# Inform Makefile where to find *.cpp and *.o files | ||
# Project definition | ||
# | ||
VPATH += $(P)/src $(P)/src/Core | ||
include $(P)/Makefile.common | ||
TARGET_NAME := $(PROJECT_NAME) | ||
TARGET_DESCRIPTION := An open source implementation of the SimCity 2013 simulation engine GlassBox | ||
include $(M)/project/Makefile | ||
|
||
################################################### | ||
# Project defines | ||
# Compile shared and static libraries | ||
# | ||
DEFINES += -DVIRTUAL= -DDESIRED_GRID_SIZE=30u | ||
LIB_FILES := $(call rwildcard,src,*.cpp) | ||
INCLUDES := $(P)/include | ||
VPATH := $(P)/src | ||
DEFINES := -DVIRTUAL= -DDESIRED_GRID_SIZE=30u | ||
|
||
################################################### | ||
# Make the list of compiled files for the library | ||
# Generic Makefile rules | ||
# | ||
LIB_OBJS += Simulation.o Map.o City.o Unit.o Path.o Agent.o Resource.o Resources.o | ||
LIB_OBJS += ScriptParser.o MapCoordinatesInsideRadius.o MapRandomCoordinates.o | ||
LIB_OBJS += Rule.o RuleCommand.o RuleValue.o Dijkstra.o | ||
include $(M)/rules/Makefile | ||
|
||
################################################### | ||
# Compile the project as static and shared libraries. | ||
# Extra rules | ||
# | ||
.PHONY: all | ||
all: $(STATIC_LIB_TARGET) $(SHARED_LIB_TARGET) $(PKG_FILE) demo | ||
all:: demo | ||
|
||
################################################### | ||
# Compile the demo as standalone application. | ||
# | ||
.PHONY: demo | ||
demo: | $(STATIC_LIB_TARGET) $(SHARED_LIB_TARGET) | ||
@$(call print-from,"Compiling scenarios",$(PROJECT),demo) | ||
$(MAKE) -C demo all | ||
|
||
################################################### | ||
# Install project. You need to be root. | ||
# | ||
ifeq ($(ARCHI),Linux) | ||
.PHONY: install | ||
install: $(STATIC_LIB_TARGET) $(SHARED_LIB_TARGET) $(PKG_FILE) demo | ||
@$(call INSTALL_BINARY) | ||
@$(call INSTALL_DOCUMENTATION) | ||
@$(call INSTALL_PROJECT_LIBRARIES) | ||
@$(call INSTALL_PROJECT_HEADERS) | ||
endif | ||
|
||
################################################### | ||
# Compile and launch unit tests and generate the code coverage html report. | ||
# | ||
.PHONY: unit-tests | ||
unit-tests: | ||
@$(call print-simple,"Compiling unit tests") | ||
@$(MAKE) -C tests coverage | ||
|
||
################################################### | ||
# Compile and launch unit tests and generate the code coverage html report. | ||
# | ||
.PHONY: check | ||
check: unit-tests | ||
|
||
################################################### | ||
# Clean the whole project. | ||
# | ||
.PHONY: veryclean | ||
veryclean: clean | ||
@rm -fr cov-int $(PROJECT).tgz *.log foo 2> /dev/null | ||
@(cd tests && $(MAKE) -s clean) | ||
@$(call print-simple,"Cleaning","$(PWD)/doc/html") | ||
@rm -fr $(THIRDPART)/*/ doc/html 2> /dev/null | ||
@$(MAKE) -C demo clean | ||
demo: | ||
$(Q)$(MAKE) --no-print-directory --directory=demo all | ||
|
||
################################################### | ||
# Sharable informations between all Makefiles | ||
clean:: | ||
$(Q)$(MAKE) --no-print-directory --directory=demo clean | ||
|
||
include $(M)/Makefile.footer | ||
install:: | ||
$(Q)$(MAKE) --no-print-directory --directory=demo install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PROJECT_NAME := OpenGlassBox | ||
PROJECT_VERSION := 0.2.0 | ||
COMPILATION_MODE := release | ||
CXX_STANDARD := --std=c++14 | ||
PROJECT_DATA := demo/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,38 @@ | ||
|
||
################################################### | ||
# Project definition | ||
# | ||
PROJECT = OpenGlassBox | ||
TARGET = $(PROJECT) | ||
DESCRIPTION = An Open Source Implementation of the SimCity 2013 Simulation Engine GlassBox | ||
STANDARD = --std=c++14 | ||
BUILD_TYPE = debug | ||
|
||
################################################### | ||
# Location of the project directory and Makefiles | ||
# | ||
P := .. | ||
M := $(P)/.makefile | ||
include $(M)/Makefile.header | ||
|
||
################################################### | ||
# Inform Makefile where to find header files | ||
# | ||
INCLUDES += -I. -I$(P)/include -I$(P) | ||
|
||
################################################### | ||
# Inform Makefile where to find *.cpp and *.o files | ||
# | ||
VPATH += $(P) Display | ||
|
||
################################################### | ||
# Project defines | ||
# | ||
DEFINES += -DVIRTUAL= -DDESIRED_GRID_SIZE=30u | ||
DEFINES += -DDATADIR=\"$(DATADIR):$(abspath data)/:data/\" | ||
|
||
################################################### | ||
# Set Libraries. For knowing which libraries | ||
# is needed please read the external/README.md file. | ||
# Project definition | ||
# | ||
PKG_LIBS = sdl2 SDL2_image | ||
include $(P)/Makefile.common | ||
TARGET_NAME := $(PROJECT_NAME)-demo | ||
TARGET_DESCRIPTION := A demo using $(PROJECT_NAME) | ||
include $(M)/project/Makefile | ||
|
||
################################################### | ||
# Compile against the OpenGlassBox shared library | ||
# Compile the standalone application | ||
# | ||
THIRDPART_LIBS += $(abspath $(P)/$(BUILD)/libopenglassbox.a) | ||
SRC_FILES := $(call rwildcard,src,*.cpp) | ||
INCLUDES := $(P)/include $(P)/demo/src $(P) | ||
VPATH := $(P)/demo | ||
DEFINES := -DVIRTUAL= -DDESIRED_GRID_SIZE=30u | ||
INTERNAL_LIBS := $(call internal-lib,$(PROJECT_NAME)) | ||
PKG_LIBS := sdl2 SDL2_image | ||
|
||
################################################### | ||
# MacOS X | ||
# Create MacOS X bundle application. | ||
# | ||
ifeq ($(ARCHI),Darwin) | ||
BUILD_MACOS_APP_BUNDLE = 1 | ||
APPLE_IDENTIFIER = lecrapouille | ||
MACOS_BUNDLE_ICON = data/$(PROJECT).icns | ||
LINKER_FLAGS += -framework CoreFoundation | ||
ifeq ($(OS),Darwin) | ||
BUILD_MACOS_APP_BUNDLE = 1 | ||
APPLE_IDENTIFIER := lecrapouille | ||
MACOS_BUNDLE_ICON := data/$(PROJECT_NAME).icns | ||
LINKER_FLAGS := -framework CoreFoundation | ||
endif | ||
|
||
################################################### | ||
# Compile the demo as standalone application. | ||
# | ||
OBJS += DearImGui.o SDLHelper.o Window.o DataPath.o | ||
OBJS += Debug.o Draw.o Listeners.o Demo.o main.o | ||
|
||
################################################### | ||
# Compile the demo as standalone application. | ||
# Generic Makefile rules | ||
# | ||
all: $(TARGET) | ||
@cp $(BUILD)/$(TARGET) ../$(BUILD) | ||
ifeq ($(ARCHI),Darwin) | ||
@cp -r $(BUILD)/$(TARGET)$(EXT) ../$(BUILD) | ||
endif | ||
|
||
################################################### | ||
# Sharable informations between all Makefiles | ||
include $(M)/Makefile.footer | ||
include $(M)/rules/Makefile |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,17 @@ | ||
#!/bin/bash -e | ||
############################################################################### | ||
### This script is called by (cd .. && make download-external-libs). It will | ||
### git clone thirdparts needed for this project but does not compile them. | ||
### It replaces git submodules that I dislike. | ||
############################################################################### | ||
|
||
### This script will git clone some libraries that OpenGlassBox needs and | ||
### compile them. To avoid pollution, they are not installed into your | ||
### environement. Therefore OpenGlassBox Makefiles have to know where to | ||
### find their files (includes and static/shared libraries). | ||
|
||
### $1 is given by ../Makefile and refers to the current architecture. | ||
if [ "$1" == "" ]; then | ||
echo "Expected one argument. Select the architecture: Linux, Darwin or Windows" | ||
exit 1 | ||
fi | ||
ARCHI="$1" | ||
TARGET="$2" | ||
|
||
### Delete all previous directories to be sure to have and compile | ||
### fresh code source. | ||
rm -fr imgui_sdl imgui 2> /dev/null | ||
|
||
function print-clone | ||
{ | ||
echo -e "\033[35m*** Cloning:\033[00m \033[36m$TARGET\033[00m <= \033[33m$1\033[00m" | ||
} | ||
|
||
### Library for creating GUI in OpenGL | ||
### Bloat-free Graphical User interface for C++ with minimal dependencies | ||
### License: MIT | ||
print-clone imgui | ||
git clone https://github.com/ocornut/imgui.git > /dev/null 2> /dev/null | ||
(cd imgui && git reset --hard f9b873662baac2388a4ca78c967e53eb5d83d2a1) | ||
cloning ocornut/imgui -b docking | ||
(cd imgui && git fetch --unshallow && git reset --hard f9b873662baac2388a4ca78c967e53eb5d83d2a1) | ||
|
||
### ImGuiSDL: SDL2 based renderer for Dear ImGui | ||
### License: MIT | ||
### FIXME: No longer needed since now integrated directly inside imgui | ||
print-clone imgui_sdl | ||
git clone https://github.com/Tyyppi77/imgui_sdl.git --depth=1 > /dev/null 2> /dev/null | ||
cloning Tyyppi77/imgui_sdl | ||
cp imgui_sdl/imgui_sdl.cpp imgui/imgui_sdl.cpp | ||
cp imgui_sdl/imgui_sdl.h imgui/imgui_sdl.h | ||
cp imgui_sdl/imgui_sdl.h imgui/imgui_sdl.h |
Oops, something went wrong.