optimisation of size (#1)

This commit is contained in:
Mylloon 2023-05-26 21:06:23 +02:00
parent 19eebadb17
commit 363288a8ca
Signed by: Forgejo
GPG key ID: E72245C752A07631

View file

@ -2,7 +2,7 @@
# Auteur : Farès BELHADJ # Auteur : Farès BELHADJ
# Email : amsi@up8.edu # Email : amsi@up8.edu
# Date : 28/04/2020 # Date : 28/04/2020
# Modified : Anri KENNEL (anri.kennel@etud.univ-paris8.fr) - 03/05/2023 # Modified : Anri KENNEL (anri.kennel@etud.univ-paris8.fr) - 26/05/2023
# Définition des commandes utilisées # Définition des commandes utilisées
CC = gcc CC = gcc
@ -20,9 +20,10 @@ TAIL = tail
GREP = grep GREP = grep
AWK = awk AWK = awk
STRIP = strip -s STRIP = strip -s
UPX = upx
# Déclaration des options du compilateur # Déclaration des options du compilateur
COPTI = -O3 -flto COPTI = -O3
CFLAGS = -Wall $(COPTI) -std=gnu17 CFLAGS = -Wall $(COPTI) -std=gnu17
CPPFLAGS = -I. CPPFLAGS = -I.
LDFLAGS = -lm LDFLAGS = -lm
@ -69,6 +70,9 @@ CPPFLAGS += $(shell sdl2-config --cflags)
LDFLAGS += -lGL4Dummies $(shell sdl2-config --libs) -lSDL2_mixer -lSDL2_image -lSDL2_ttf LDFLAGS += -lGL4Dummies $(shell sdl2-config --libs) -lSDL2_mixer -lSDL2_image -lSDL2_ttf
all: $(PROGNAME) all: $(PROGNAME)
all: strip
all: upx
$(PROGNAME): $(OBJ) $(PROGNAME): $(OBJ)
$(CC) $(OBJ) $(LDFLAGS) -o $(PROGNAME) $(CC) $(OBJ) $(LDFLAGS) -o $(PROGNAME)
@ -84,6 +88,9 @@ debug: $(PROGNAME)
strip: strip:
$(STRIP) $(PROGNAME) $(STRIP) $(PROGNAME)
upx:
$(UPX) $(PROGNAME)
dist: distdir dist: distdir
$(CHMOD) -R a+r $(distdir) $(CHMOD) -R a+r $(distdir)
$(TAR) zcvf $(distdir).tgz $(distdir) $(TAR) zcvf $(distdir).tgz $(distdir)