aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: bc6ca146773bf12ec5f3a36d613b0b8ea4f59b5a (about) (plain)
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
# Previously there were also:
#  * -Ilibspopc-0.12/ in INCLUDEFLAGS
#  * -Llibspopc-0.12/ and -lspopc in LIBFLAGS
#  * -DUSE_SSL in CFLAGS
# libspopc now got replaced with VMime, which also handles mail parsing
INCLUDEFLAGS = -Iiniparser-4.1/src/ -Ivmime-master/src/ \
	-Ivmime-master/config_header/

LIBFLAGS = -static -Lvmime-master/ -Lopenssl-1.1.0h/ -Liniparser-4.1/ \
	-liniparser -lvmime -lssl -lcrypto -lcrypt32 -lws2_32 -lwsock32
CC = i686-w64-mingw32-gcc
CXX = i686-w64-mingw32-g++
STRIP = i686-w64-mingw32-strip
CFLAGS = $(INCLUDEFLAGS) -Wall -O2 -std=c11
CXXFLAGS = $(INCLUDEFLAGS) -Wall -O2 -std=c++11

PROGRAMS = pop.exe push.exe
COMMON_O = config.o messages.o misc.o CA_store.o timeout_handler.o exceptions.o
POP_OBJECTS = pop.o $(COMMON_O)
PUSH_OBJECTS = push.o $(COMMON_O)

all: $(PROGRAMS)

#	stripping nie jest konieczny, ale zmniejsza rozmiar pliku o ponad 25%
pop.exe: $(POP_OBJECTS)
	$(CXX) $^ $(LIBFLAGS) -o $@
	$(STRIP) $@

push.exe: $(PUSH_OBJECTS)
	$(CXX) $^ $(LIBFLAGS) -o $@
	$(STRIP) $@

clean:
	-rm -f $(PROGRAMS) *.o

%.o: %.c
	$(CC) -c $< -o $@ $(CFLAGS)

%.o: %.cpp
	$(CXX) -c $< -o $@ $(CXXFLAGS)

.PHONY: all clean