Trying to compile OpenSSL with GNU Make for Windows? Fix here!

I know this will sound silly, but it took me a lot of googling and mixing.

Been having some issues while manually compiling OpenSSL with GNU Make for Windows.
OpenSSL does not add implicit rules for C compilation, and the GNU Make for Windows defaults to G++, causing errors (mostly, missing include files).

You could go around all makefiles and add all the default rules, one at a time, or you can follow my lead:

Create a text file, with a name you can recognize.
Place it in your openssl-x.y.z directory.
It will contain our C rules, I named it makefile.c_rules_fix.

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


Create a batch file in the same directory, with these contents:

export MAKEFILES=$(PWD)/makefile.c_rules_fix
echo Adapt the following command for your system.
echo To build a static library, remove shared.
echo To build for mingw32, use "mingw".
echo Run ./Configure for more.
./Configure shared mingw64
make depend
make
make install


Open a MSYS prompt and run the batch file.
Last edited on
Wouldn't overriding the variable on the command line also be an option? I haven't tried it for OpenSSL in particular, but this has worked for me in the past.
Not for OpenSSL. They have some really weird stuff going on.
Topic archived. No new replies allowed.