CMakeLists.txt + rm Makefile
This commit is contained in:
1 parent
7dbb3977df
commit
370e01bd67
2 files changed
+8
-29
No files matched your search
+8
-4
@@ -1,12 +1,16 @@
|
|||||||
#version minimale de cmake nécessaire
|
#version minimale de cmake nécessaire
|
||||||
cmake_minimum_required(VERSION 2.6)
|
cmake_minimum_required(VERSION 2.6)
|
||||||
|
|
||||||
#nom du projet
|
#nom du projet
|
||||||
project ()
|
project (game_text)
|
||||||
|
|
||||||
#positionne la variable
|
#positionne la variable
|
||||||
set(CMAKE_C_FLAGS "-std=c99 -g -Wall")
|
set(CMAKE_C_FLAGS "-std=c99 -g -Wall")
|
||||||
|
|
||||||
#définit le nom du programme ainsi que
|
#définit le nom du programme ainsi que
|
||||||
#ses sources
|
#ses sources
|
||||||
add_executable()
|
add_executable(game_text game_text.c)
|
||||||
|
|
||||||
#les dépendances sont calculées automatiquement
|
#les dépendances sont calculées automatiquement
|
||||||
target_link_libraries()
|
target_link_libraries(game_text libgame)
|
||||||
add_library ()
|
add_library (libgame game.o game_aux.c)
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
CC=gcc # compilateur
|
|
||||||
CFLAGS=-Wall -std=c99 # options de compilation
|
|
||||||
LDFLAGS=-L. # options de link
|
|
||||||
LDLIBS=-lgame # bibliothèques
|
|
||||||
CPPFLAGS= # options de preprocessing
|
|
||||||
AR= ar
|
|
||||||
|
|
||||||
all: game_text
|
|
||||||
|
|
||||||
libgame.a: game_aux.o game.o
|
|
||||||
$(AR) rcs $@ $^
|
|
||||||
|
|
||||||
game_text: game_text.o libgame.a
|
|
||||||
$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS)
|
|
||||||
|
|
||||||
.PHONY: clean dep
|
|
||||||
|
|
||||||
include dep
|
|
||||||
|
|
||||||
# génération des dépendances
|
|
||||||
dep:
|
|
||||||
$(CC) -MM *.c > dep
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f dep game_aux.o *~ game_text game_text.o libgame.a
|
|
||||||
Reference in new issue
Block a user