Browse Source

Cleanup Makefile and remove obsolete packaging, LTO and DEBUG support

- optimization is -Ofast -march=native now per default
- binary is now static by default
- LTO support has been removed because it only is around 5-10% faster
  but is a pain to maintain.
- DEBUG support with profiling was not used at all
tags/v1.1
Bernhard Fröhlich 11 months ago
parent
commit
2f0a315c56
Signed by: Bernhard Froehlich <decke@bluelife.at> GPG Key ID: 4DD88C3F9F3B8333
1 changed files with 3 additions and 49 deletions
  1. 3
    49
      Makefile

+ 3
- 49
Makefile View File

@@ -3,13 +3,9 @@
#

CC ?= cc
LD ?= ld
CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -maes
LDFLAGS += -static

INSTALL = install -c
STRIP = strip
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
VERSION = 1.0

# add git revision if .git exists
@@ -19,20 +15,8 @@ else
CFLAGS += -DREVISION="$(shell git rev-parse --short HEAD)"
endif

ifeq ($(DEBUG),1)
# for debugging
CFLAGS += -g -Wall -Werror
LDFLAGS += -pg
else
# for release
CFLAGS += -Ofast

# enable LTO for gcc
ifeq ($(shell $(CC) --version | grep gcc >/dev/null; echo $$?),0)
CFLAGS += -flto
LDFLAGS += -flto
endif
endif
CFLAGS += -Ofast -march=native

# we need to link to libc/msvcrt
ifeq ($(OS),Windows_NT)
@@ -43,44 +27,14 @@ CFLAGS += -DHAVE_POSIX_MEMALIGN
LDFLAGS += -lc
endif

RELDIR = drmdecrypt-$(VERSION)

##########################

SRC = AES.c AESNI.c buffer.c drmdecrypt.c
OBJS = AES.o AESNI.o buffer.o drmdecrypt.o
OBJS = $(SRC:.c=.o)

all: drmdecrypt

drmdecrypt: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS)

drmdecrypt-static: $(OBJS)
$(CC) $(LDFLAGS) -static -o $@ $(OBJS)

install: all
$(STRIP) drmdecrypt
$(INSTALL) drmdecrypt $(BINDIR)/drmdecrypt

release-win: all
rm -rf $(RELDIR)-win
mkdir $(RELDIR)-win
cp LICENSE README.md drmdecrypt.exe $(RELDIR)-win
$(STRIP) $(RELDIR)-win/*.exe

release-x64: drmdecrypt drmdecrypt-static
rm -rf $(RELDIR)-x64
mkdir $(RELDIR)-x64
cp LICENSE README.md drmdecrypt drmdecrypt-static $(RELDIR)-x64
tar cvfj $(RELDIR)-x64.tar.bz2 $(RELDIR)-x64

release-src:
rm -rf $(RELDIR)-src
mkdir $(RELDIR)-src
cp LICENSE README.md *.c *.h Makefile $(RELDIR)-src
tar cvfj $(RELDIR)-src.tar.bz2 $(RELDIR)-src

clean:
rm -f *.o *.core drmdecrypt drmdecrypt.exe
rm -rf $(RELDIR)


Loading…
Cancel
Save