Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Nom du projet, utilisé pour le nom du fichier de sortie finale.
- BIN_NAME = osumax
- # Compilateur à utiliser.
- CC = g++
- # Paramètres de base du compilateur.
- CC_ARGS = -IHeaders/ -ILibraries/ns_framework/Headers
- CC_ARGS += -ILibraries/osumax_shared/Headers -std=c++11 -fPIC
- # Paramètres spécifique pour chaque fichier. Le nom du fichier est sans les
- # dossier et sans l'extension (ex. dossier/fichier.cpp -> CC_ARGS_fichier).
- # Exemple :
- # CC_ARGS_NomDuFichier = Paramètres du compilateur.
- # Lieur à utiliseur.
- LD = g++
- # Paramètres du lieur
- LD_ARGS = -L./Libraries/
- # Librairies à utiliser.
- LD_LIBS = -lns_framework -ltinyxml2 -lsfml-system -lsfml-window -lsfml-graphics
- # Dossier contenant les fichiers sources.
- SRC_DIR = Sources
- # Dossier de sortie contenant les fichiers intermédiaire.
- OBJ_DIR = Objects
- # Dossier de sortie contenant le fichier de sortie finale ainsi que les
- # resources.
- BIN_DIR = .
- # Si on est en version de débug
- ifeq (@(VARIANT),Debug)
- CC_ARGS += -g -Wall -DDEBUG
- endif
- # Si on est en version de production
- ifeq (@(VARIANT),Release)
- CC_ARGS += -O3 -Wall -Werror -DRELEASE
- endif
- # Si on vise la platforme Linux
- ifeq (@(PLATFORM),Linux)
- CC_ARGS += -DLINUX
- endif
- # Si on vise la platforme Windows (pas supporté actuellement)
- ifeq (@(PLATFORM),Windows)
- error Windows platform not currently supported.
- endif
- # Si on vise l'architecture x86_64 (64bits)
- ifeq (@(ARCH),x86_64)
- CC_ARGS += -DX86_64 -m64
- ifeq (@(PLATFORM),Linux)
- LD_ARGS += -m64
- endif
- endif
- # Si on vise l'architecture i386 (32bits)
- ifeq (@(ARCH),i386)
- CC_ARGS += -DI386 -m32
- ifeq (@(PLATFORM),Linux)
- LD_ARGS += -m32
- endif
- endif
- # On définie des macros standards.
- !compile = |> ^ Compiling %f... ^ $(CC) $(CC_ARGS) $(CC_ARGS_%g) -c -o %o %f |>
- !link = |> $(LD) $(LD_ARGS) $(LD_LIBS) -o %o %f |>
- # Liste des règles.
- # Compilation des fichiers sources.
- : foreach Sources/*.cpp |> !compile |> Objects/%g.o {OBJECTS}
- # Liage des fichiers intermédiaires vers le fichier de sortie final.
- : {OBJECTS} | Libraries/<LIBRARIES> |> !link |> $(BIN_DIR)/$(BIN_NAME)
- : $(BIN_DIR)/$(BIN_NAME) |> bash Scripts/gen_run.sh > %o |> $(BIN_DIR)/run.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement