File: Makefile.w32

package info (click to toggle)
sks-ecc 0.92b-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,484 kB
  • ctags: 2,510
  • sloc: ansic: 19,812; makefile: 403; sh: 400
file content (160 lines) | stat: -rwxr-xr-x 3,071 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# Makefile for sks (win32)
# gcc (Mingw32)

CFLAGS = -DWIN32
WIN=1
VER		=0.92
ES=0
EN=1
CC=gcc
MAKE=mingw32-make

# *******************************
# ***** START build configuration area
# ***** You may comment/uncomment definitions and flags
# ***** Some defs/flags have mandatory alternative, some not
# ******************************

INST=C:\WINDOWS

# ******* If you don't have 'libtommath' installed
LTM = ltm

# ******* If you don't have 'libtomcrypt' installed
LTC = ltc

# ******** If you don't have 'zlib' installed
GZ = zlib

# specify architecture here
ARCH	=i386
#ARCH=pentium4

# specify language ES, EN or input as command-line option i.e.: 'make SLANG=0'
#SLANG=$(ES)

CFLAGS	+= -s -march=$(ARCH) -DVERSION='"$(VER)"' -DSKS_LANG=$(SLANG)

# uses /dev/random or WinNT crypt-random
CFLAGS += -DDEVRANDOM

#warnings
CFLAGS += -Wall
#-Wsign-compare -W -Wno-unused -Wshadow -Werror

#  optimize for SPEED (don't include SIZE options)
#CFLAGS += -O3 -funroll-loops
#  add -fomit-frame-pointer.  v3.2 is buggy for certain platforms!
#CFLAGS += -fomit-frame-pointer -DFULLTABLES

#  optimize for SIZE (don't include SPEED options)
CFLAGS += -Os -DSMALL_CODE

# *******************************
# ***** END build configuration area
# ******************************


# ******** If you don't have 'zlib' installed
ifdef GZ

default: gz sks

gz: $(GZ)/libz.a

$(GZ)/libz.a:
	$(MAKE) -C $(GZ) -f win32/Makefile.gcc libz.a
	
ZLIB = $(GZ)/libz.a
CFLAGS += -I$(GZ)
else

# ******** If you DO have 'zlib' installed
default: sks
ZLIB = -lz
endif

# ******* If you don't have 'libtommath' installed
ifdef LTM

LTMLIB = $(LTM)/mpi.o
CFLAGS += -I$(LTM)

else

# ******* If you DO have 'libtommath' installed
LTMLIB = -ltommath
endif

# ******* If you don't have 'libtocrypt' installed
ifdef LTC

LTCLIB=$(LTC)/aes.o $(LTC)/tiger.o
CFLAGS += -I$(LTC)

else

# ******* If you DO have 'libtomcrypt' installed:
LTCLIB = -ltomcrypt
endif

ECC_OBJS= gflib.o eclib.o eccrypt.o
gflib.o: gflib.c gflib.h
eclib.o: eclib.c eclib.h gflib.h
eccrypt.o: eccrypt.c eccrypt.h eclib.h gflib.h
util.o: util.c sks.h

UTIL_OBJS=binasc.o util.o entropy.o hash.o symcrypt.o

KEY_OBJS=keyring.o

# *** Build the 'kernel'
LIBS = $(UTIL_OBJS) $(ECC_OBJS) $(KEY_OBJS) $(LTMLIB) $(LTCLIB) $(ZLIB)

sks.o: sks.c sks_msg_en.h sks_msg_es.h sks.h

DEPLIST = $(UTIL_OBJS) $(KEY_OBJS) $(ECC_OBJS) sks.o

ifdef LTM
DEPLIST += $(LTMLIB)
endif
ifdef LTC
DEPLIST += $(LTCLIB)
endif
ifdef GZ
DEPLIST += gz
endif

lang_test:
	echo $(SLANG);

sks: $(DEPLIST)
	$(CC) -o $@ $@.o $(LIBS)

# *** Clean

PIGS = *.o sks.exe sks.sig
ifdef LTM
PIGS += $(LTM)\mpi.o
endif
ifdef LTC
PIGS += $(LTC)\aes.o $(LTC)\tiger.o
endif
ifdef GZ
PIGS += $(GZ)\*.o $(GZ)\*.a
endif

clean: limpia
limpia:
		del $(PIGS)

# Tests
skstest: skstest.o $(ECC_OBJS) $(UTIL_OBJS) $(KEY_OBJS)
	$(CC) $@.o  $(UTIL_OBJS) $(ECC_OBJS) $(KEY_OBJS) $(LTCLIB) $(LTMLIB) $(ZLIB) -o $@
#skstest: skstest.o $(LTC_OBJS) $(ECC_OBJS) $(UTIL_OBJS)
#	$(CC) $@.o -I. $(LTC_OBJS) $(ECC_OBJS) $(UTIL_OBJS) $(LTMLIB) $(ZLIB) -o $@


install: sks
	copy sks.exe $(INST)