aboutsummaryrefslogtreecommitdiff
# 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