summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-10-04 00:57:07 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-10-04 00:57:07 +0200
commitad4fddc454407fe154e87564472332e5c421452a (patch)
treef1005f38ff34a8001f7d8f1985d3bd8aecd545b0
parent69401cf03ede9563b48904228b0d8801defd0c04 (diff)
Small tweaks to the Makefile; adding flto for true linu output.
-rw-r--r--Makefile15
1 files changed, 11 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 319997f..58c41bf 100644
--- a/Makefile
+++ b/Makefile
@@ -8,10 +8,12 @@ DISTRIB = $(shell cat /etc/issue | cut -f 1 -d\ | head -1)
CC = gcc
CXX = g++
-LD = g++ -m32
-AS = gcc -c -m32
+LD = g++
+AS = gcc -c
AR = ar rcs
+CPPFLAGS = -O3
+
ifeq ($(SYSTEM),Darwin)
ARCH_FLAGS = -arch i386
LIBS = -liconv
@@ -28,6 +30,8 @@ else
ARCH_FLAGS = -march=i686 -m32
ASFLAGS = -march=i686 --32
STRIP = strip --strip-unneeded
+ CPPFLAGS += -flto
+ LDFLAGS += -flto -O3
endif
INCLUDES = -Iincludes
@@ -62,13 +66,16 @@ all: dep lib
tests: $(TESTS)
for t in $(TESTS) ; do ./$$t ; done
+strip: $(TESTS)
+ for t in $(TESTS) ; do $(STRIP) ./$$t ; done
+
lib: $(LIB)
libBalau.a: $(BALAU_OBJECTS)
$(AR) libBalau.a $(BALAU_OBJECTS)
test-String: test-String.o $(LIB)
- $(LD) -o $@ $< ./$(LIB)
+ $(LD) $(LDFLAGS) -o $@ $< ./$(LIB)
dep: $(ALL_DEPS)
@@ -80,4 +87,4 @@ dep: $(ALL_DEPS)
clean:
rm -f $(ALL_OBJECTS) $(TESTS) $(LIB) $(ALL_DEPS)
-.PHONY: lib tests clean
+.PHONY: lib tests clean strip