Skip to content

Instantly share code, notes, and snippets.

@gvanem
Created August 22, 2017 10:51
Show Gist options
  • Select an option

  • Save gvanem/de1530d2b3f8e3d109fc876dd8174057 to your computer and use it in GitHub Desktop.

Select an option

Save gvanem/de1530d2b3f8e3d109fc876dd8174057 to your computer and use it in GitHub Desktop.
#
# Nmake makefile for IP2Location (MSVC)
# Ref: https://github.com/chrislim2888/IP2Location-C-Library
#
TARGET_LIB = libIP2Location/IP2Location.lib
TARGET_TEST = test/test-IP2Location.exe
CFLAGS = -nologo -DWIN32 -MD -I./libIP2Location -DPACKAGE_VERSION=\"8.0.4\"
LDFLAGS = -nologo -debug -map -incremental:no
IP2LOCATION_SOURCE = libIP2Location/IP2Location.c \
libIP2Location/IP2Loc_DBInterface.c
TEST_IP2LOCATION = test/test-IP2Location.c
all: $(TARGET_LIB) $(TARGET_TEST)
.c.obj:
cl -c $(CFLAGS) -Fo$@ $<
$(TARGET_LIB): $(IP2LOCATION_SOURCE:.c=.obj)
lib -nologo -out:$@ $**
$(TARGET_TEST): $(TEST_IP2LOCATION:.c=.obj) $(TARGET_LIB)
link $(LDFLAGS) -out:$@ $** user32.lib ws2_32.lib
clean:
rm -f $(IP2LOCATION_SOURCE:.c=.obj) $(TARGET_LIB)
rm -f $(TARGET_TEST) $(TARGET_TEST:.exe=.map) $(TARGET_TEST:.exe=.obj) $(TARGET_TEST:.exe=.pdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment