add simple Makefile to build with mingw32

This commit is contained in:
KIU Shueng Chuan 2013-03-03 15:39:44 +08:00
parent 3176509e60
commit 679869d981
2 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,31 @@
CC=gcc
CFLAGS=-Wall -Os -g -DDLL_EXPORT -DFD_SETSIZE=1024 -I.
LIBS=-lws2_32
OBJS = address.o clock.o ctx.o dealer.o decoder.o devpoll.o dist.o encoder.o epoll.o err.o fq.o \
io_object.o io_thread.o ip.o ipc_address.o ipc_connecter.o ipc_listener.o kqueue.o lb.o \
mailbox.o msg.o mtrie.o object.o options.o own.o pair.o pgm_receiver.o pgm_sender.o \
pgm_socket.o pipe.o poll.o poller_base.o precompiled.o proxy.o pub.o pull.o push.o \
random.o raw_decoder.o raw_encoder.o reaper.o rep.o req.o router.o select.o session_base.o \
signaler.o socket_base.o stream_engine.o sub.o tcp.o tcp_address.o tcp_connecter.o tcp_listener.o \
thread.o trie.o v1_decoder.o v1_encoder.o xpub.o xsub.o zmq.o zmq_utils.o
%.o: ../../src/%.cpp
$(CC) -c -o $@ $< $(CFLAGS)
%.o: ../../perf/%.cpp
$(CC) -c -o $@ $< $(CFLAGS)
all: libzmq.dll
perf: inproc_lat.exe inproc_thr.exe local_lat.exe local_thr.exe remote_lat.exe remote_thr.exe
libzmq.dll: $(OBJS)
g++ -shared -o $@ $^ -Wl,--out-implib,$@.a $(LIBS)
%.exe: %.o libzmq.dll
g++ -o $@ $^
clean:
del *.o *.a *.dll *.exe

View File

@ -0,0 +1,32 @@
/*
Copyright (c) 2007-2011 iMatix Corporation
Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
This file is part of 0MQ.
0MQ is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
0MQ is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __ZMQ_PLATFORM_HPP_INCLUDED__
#define __ZMQ_PLATFORM_HPP_INCLUDED__
// This is the platform definition for the MSVC platform.
// As a first step of the build process it is copied to
// zmq directory to take place of platform.hpp generated from
// platform.hpp.in on platforms supported by GNU autotools.
// Place any MSVC-specific definitions here.
#define ZMQ_HAVE_WINDOWS
#endif