Skip to content

Commit

Permalink
adapt for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lifenjoiner committed Mar 22, 2019
1 parent d3fc976 commit b58361c
Show file tree
Hide file tree
Showing 11 changed files with 3,602 additions and 2,881 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Mkfile.old
dkms.conf

# config
autom4te.cache/
config.status
config.log
*.old
Makefile
24 changes: 13 additions & 11 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,32 @@ OBJECTS=nbtscan.o statusq.o range.o list.o
DEFS=@DEFS@
TARGET=@TARGET@

srcdir = @srcdir@

prefix = @prefix@
exec_prefix = @exec_prefix@
BINDIR = @bindir@

nbtscan: $(OBJECTS)
$(CC) $(CFLAGS) -o nbtscan $(OBJECTS) $(LIBS)
$(TARGET): $(OBJECTS)
$(CC) $(CFLAGS) -o $@ $(OBJECTS) $(LIBS)

install:
$(INSTALL) $(TARGET) $(BINDIR)/$(TARGET)

nbtscan.o: nbtscan.c statusq.h range.h list.h
$(CC) $(CFLAGS) $(DEFS) -c nbtscan.c
nbtscan.o: $(srcdir)/nbtscan.c $(srcdir)/statusq.h $(srcdir)/range.h $(srcdir)/list.h
$(CC) $(CFLAGS) $(DEFS) -c $<

statusq.o: statusq.c statusq.h
$(CC) $(CFLAGS) $(DEFS) -c statusq.c
statusq.o: $(srcdir)/statusq.c $(srcdir)/statusq.h
$(CC) $(CFLAGS) $(DEFS) -c $<

range.o: range.c range.h
$(CC) $(CFLAGS) $(DEFS) -c range.c
range.o: $(srcdir)/range.c $(srcdir)/range.h
$(CC) $(CFLAGS) $(DEFS) -c $<

list.o: list.c list.h
$(CC) $(CFLAGS) $(DEFS) -c list.c
list.o: $(srcdir)/list.c $(srcdir)/list.h
$(CC) $(CFLAGS) $(DEFS) -c $<

clean:
-rm $(OBJECTS) nbtscan
-rm $(OBJECTS) $(TARGET)

distclean: clean
-rm config.cache config.log config.status Makefile
35 changes: 35 additions & 0 deletions Makefile.mingw
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
INSTALL=/usr/bin/install -c
CC=gcc
LIBS=-lws2_32
CFLAGS = -Os -s
OBJECTS=nbtscan.o statusq.o range.o list.o
DEFS=-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_STDINT_H=1 -Dmy_uint8_t=uint8_t -Dmy_uint16_t=uint16_t -Dmy_uint32_t=uint32_t -DTIME_WITH_SYS_TIME=1 -DHAVE_SNPRINTF=1 -DWINDOWS=1
TARGET=nbtscan.exe

prefix = /usr/local
exec_prefix = ${prefix}
BINDIR = ${exec_prefix}/bin

$(TARGET): $(OBJECTS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)

install:
$(INSTALL) $(TARGET) $(BINDIR)/$(TARGET)

nbtscan.o: nbtscan.c statusq.h range.h list.h
$(CC) $(CFLAGS) $(DEFS) -c nbtscan.c

statusq.o: statusq.c statusq.h
$(CC) $(CFLAGS) $(DEFS) -c statusq.c

range.o: range.c range.h
$(CC) $(CFLAGS) $(DEFS) -c range.c

list.o: list.c list.h
$(CC) $(CFLAGS) $(DEFS) -c list.c

clean:
-rm $(OBJECTS) $(TARGET)

distclean: clean
-rm config.cache config.log config.status Makefile
Loading

0 comments on commit b58361c

Please sign in to comment.