forked from zeromq/zproject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zproject_mingw32.gsl
48 lines (38 loc) · 1.41 KB
/
zproject_mingw32.gsl
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
# Generate Mingw32 makefile for project
#
# This is a code generator built using the iMatix GSL code generation
# language. See https://github.com/imatix/gsl for details.
#
# Copyright (c) the Contributors as noted in the AUTHORS file.
# This file is part of zproject.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
register_target ("mingw32", "Mingw32 build system")
.macro target_mingw32
.directory.create('builds/mingw32')
.output "builds/mingw32/Makefile.mingw32"
$(project.GENERATED_WARNING_HEADER:)
CC=gcc
# replace the following with wherever you have installed libzmq
PREFIX=c:/mingw/msys/1.0/local
INCDIR=-I$\(PREFIX)/include -I.
LIBDIR=-L$\(PREFIX)/lib
CFLAGS=-Wall -Os -g -D$(PROJECT.LIBNAME)_EXPORTS $\(INCDIR)
OBJS =\
.for class
$(name:c).o\
.endfor
%.o: ../../src/%.c
$\(CC) -c -o $@ $< $\(CFLAGS)
all: $(project.libname).dll $(project.prefix)_selftest.exe
$(project.libname).dll: $\(OBJS)
$\(CC) -shared -o $@ $\(OBJS) -Wl,--out-implib,[email protected] $\(LIBDIR) -lzmq -lws2_32 -liphlpapi -lrpcrt4
# the test functions are not exported into the DLL
$(project.prefix)_selftest.exe: $(project.prefix)_selftest.o $\(OBJS)
$\(CC) -o $@ $^ $\(LIBDIR) -lzmq -lws2_32 -liphlpapi -lrpcrt4
clean:
del *.o *.a *.dll *.exe
$(project.GENERATED_WARNING_HEADER:)
.endmacro