X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=f18d26e6e94b6e35ab44df1aa554c29e14892e02;hb=7eaf128fac9de00394c664f59f40bebae8b122b2;hp=0df793e8c1b33c1fe422d6e64774a62f6840daee;hpb=d4bea61c8f1e5fb1a68c401610bd424c052ef636;p=picodrive.git diff --git a/Makefile b/Makefile index 0df793e8..f18d26e6 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,10 @@ TARGET ?= PicoDrive CFLAGS += -Wall -ggdb -falign-functions=2 CFLAGS += -I. ifndef DEBUG -CFLAGS += -O2 -DNDEBUG +CFLAGS += -O2 -DNDEBUG -ffunction-sections +ifeq ($(findstring clang,$(CC)),) +LDFLAGS += -Wl,--gc-sections +endif endif #CFLAGS += -DEVT_LOG #CFLAGS += -DDRC_CMP @@ -149,11 +152,13 @@ else OBJS += platform/common/mp3_dummy.o endif +ifneq "$(DONT_COMPILE_IN_ZLIB)" "1" # zlib OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \ zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o # unzip OBJS += unzip/unzip.o unzip/unzip_stream.o +endif include platform/common/common.mak @@ -173,7 +178,11 @@ clean: $(RM) -r .opk_data $(TARGET): $(OBJS) +ifeq ($(STATIC_LINKING), 1) + $(AR) rcs $@ $(OBJS) +else $(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) $(LDLIBS) +endif pprof: platform/linux/pprof.c $(CC) -O2 -ggdb -DPPROF -DPPROF_TOOL -I../../ -I. $^ -o $@