Select Git revision
Makefile 1.81 KiB
CC := gcc
# La variable CFLAGS contient les flags de compilation :
CFLAGS := -g -Wall -Wextra -pedantic -fsanitize=address
# La variable LDFLAGS contient les flags pour l' éditeur
# de liens :
LDFLAGS := -lm -lSDL2 -fsanitize=address
# Définition des sources
SOURCES := main.c tree/quadtree.c matrix/matrix.c pgm/pgm.c
# OBJECTS contient SOURCES avec .c qui devient .o
OBJECTS := $(SOURCES:.c=.o)
# galaxy sera l' exécutable ( galaxy .c contient le main)
TARGET := main
PATH := -I/home/mezmer/gitlab/appels_systeme
default:
@echo "Available targets :"
@echo "bigfile generates a 10 MB file of random data from / dev / urandom"
@echo "copybench generates the copybench executable ( dynamically linked )"
@echo "copybench_static generates the copybench_static executable ( statically linked )"
@echo "run executes copybench and copybench_static"
@echo "clean deletes all generated files ( including bigfile )"
run: bigfile, copybench, copybench_static, copybench.o, copybench_static.o
gcc -o copybench copybench.o
gcc -o copybench_static copybench_static.o
copybench: copy.o libcopy.so.1.0.0
bash copybench.sh
ln -s libcopy.so.1.0.0 libcopy.so.1
ln -s libcopy.so.1.0.0 libcopy.so
copybench_static: copy.o
ar rcs -o libcopy.a copy.o
libcopy.so.1.0.0: copy.o
gcc -shared -W1,-soname,libcopy.so.1 copy.o -o libcopy.so.1.0.0
copy.o: copy.h
gcc -fPIC -c copy.c copyf.c
copybench.o:
gcc -c $(PATH) copybench.c
copybench_static.o:
gcc -c $(PATH) copybench_static.c
bigfile:
dd if=/dev/urandom of=bigfile bs=10k count=1000
# PHONY signifie qu 'on ne crée rien avec les cibles
# mentionnées . Ici clean est la cible utilisée pour
# enlever tous les fichier .o et l' exécutable
# exécute toujours clean , même si un ficher `clean ` existe
.PHONY: clean
clean: # aucune dépendance
rm -f *.o copybench *.so *.a bigfile