Skip to content

Commit

Permalink
windows version built support
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven committed Jun 16, 2015
1 parent e0fcca0 commit 979778d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
28 changes: 28 additions & 0 deletions Makefile.mingw32
@@ -0,0 +1,28 @@
#
# VERSION CHANGES
#
#usage: CC=i686-w64-mingw32.static-gcc make -f Makefile.mingw32
#depends on https://github.com/witwall/mman-win32
LOCATION=/usr/local
#CFLAGS=-Wall -g -I. -O2 -s
CFLAGS=-Wall -ggdb -I. -O0

LIBS=-lws2_32 -lmman
OBJ=undark
OFILES=varint.o
default: undark

.c.o:
${CC} ${CFLAGS} $(COMPONENTS) -c $*.c

all: ${OBJ}

undark: ${OFILES} undark.c
${CC} ${CFLAGS} $(COMPONENTS) undark.c ${OFILES} -o undark.exe ${LIBS}

install: ${OBJ}
cp undark ${LOCATION}/bin/
cp undark.1 ${LOCATION}/man/man1

clean:
rm -f *.o *core ${OBJ}
9 changes: 8 additions & 1 deletion undark.c
Expand Up @@ -17,12 +17,19 @@
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <sys/mman.h>
//#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
//#include <arpa/inet.h>
#ifndef _WIN32
#include <arpa/inet.h>
#include <sys/mman.h>
#else
#include <winsock2.h>
#include <mman.h>
#endif
#include <ctype.h>
#include <time.h>
#include <errno.h>
Expand Down
2 changes: 1 addition & 1 deletion varint.c
Expand Up @@ -2,7 +2,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <arpa/inet.h>
//#include <arpa/inet.h>

#include "varint.h"

Expand Down

0 comments on commit 979778d

Please sign in to comment.