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 8 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 @@
3 3
 #
4 4
 
5 5
 CC	?= cc
6
-LD	?= ld
7 6
 CFLAGS	+= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -maes
7
+LDFLAGS	+= -static
8 8
 
9
-INSTALL	= install -c
10
-STRIP	= strip
11
-PREFIX	= /usr/local
12
-BINDIR	= $(PREFIX)/bin
13 9
 VERSION	= 1.0
14 10
 
15 11
 # add git revision if .git exists
@@ -19,20 +15,8 @@ else
19 15
 CFLAGS	+= -DREVISION="$(shell git rev-parse --short HEAD)"
20 16
 endif
21 17
 
22
-ifeq ($(DEBUG),1)
23
-# for debugging
24
-CFLAGS	+= -g -Wall -Werror
25
-LDFLAGS	+= -pg
26
-else
27 18
 # for release
28
-CFLAGS	+= -Ofast
29
-
30
-# enable LTO for gcc
31
-ifeq ($(shell $(CC) --version | grep gcc >/dev/null; echo $$?),0)
32
-CFLAGS	+= -flto
33
-LDFLAGS	+= -flto
34
-endif
35
-endif
19
+CFLAGS	+= -Ofast -march=native
36 20
 
37 21
 # we need to link to libc/msvcrt
38 22
 ifeq ($(OS),Windows_NT)
@@ -43,44 +27,14 @@ CFLAGS += -DHAVE_POSIX_MEMALIGN
43 27
 LDFLAGS	+= -lc
44 28
 endif
45 29
 
46
-RELDIR	= drmdecrypt-$(VERSION)
47
-
48 30
 ##########################
49 31
 
50 32
 SRC	= AES.c AESNI.c buffer.c drmdecrypt.c
51
-OBJS	= AES.o AESNI.o buffer.o drmdecrypt.o
33
+OBJS	= $(SRC:.c=.o)
52 34
 
53 35
 all:	drmdecrypt
54 36
 
55 37
 drmdecrypt:	$(OBJS)
56
-	$(CC) $(LDFLAGS) -o $@ $(OBJS)
57
-
58
-drmdecrypt-static:	$(OBJS)
59
-	$(CC) $(LDFLAGS) -static -o $@ $(OBJS)
60
-
61
-install:	all
62
-	$(STRIP) drmdecrypt
63
-	$(INSTALL) drmdecrypt $(BINDIR)/drmdecrypt
64
-
65
-release-win:	all
66
-	rm -rf $(RELDIR)-win
67
-	mkdir $(RELDIR)-win
68
-	cp LICENSE README.md drmdecrypt.exe $(RELDIR)-win
69
-	$(STRIP) $(RELDIR)-win/*.exe
70
-
71
-release-x64:	drmdecrypt drmdecrypt-static
72
-	rm -rf $(RELDIR)-x64
73
-	mkdir $(RELDIR)-x64
74
-	cp LICENSE README.md drmdecrypt drmdecrypt-static $(RELDIR)-x64
75
-	tar cvfj $(RELDIR)-x64.tar.bz2 $(RELDIR)-x64
76
-
77
-release-src:
78
-	rm -rf $(RELDIR)-src
79
-	mkdir $(RELDIR)-src
80
-	cp LICENSE README.md *.c *.h Makefile $(RELDIR)-src
81
-	tar cvfj $(RELDIR)-src.tar.bz2 $(RELDIR)-src
82 38
 
83 39
 clean:
84 40
 	rm -f *.o *.core drmdecrypt drmdecrypt.exe
85
-	rm -rf $(RELDIR)
86
-

Loading…
Cancel
Save