-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmakefile
46 lines (35 loc) · 889 Bytes
/
makefile
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
# Author: Thomas Daley
# Date: September 16, 2016
# Purpose: Basic Build Template for Windows Programs.
#
# Note: Microsoft Visual C++ Build Tools are assumed to be installed and
# added to PATH.
#
# 1) vcvarsall x86
# 2) nmake
APPNAME = wc
CONSOLE_APP = /SUBSYSTEM:CONSOLE
GUI_APP = /SUBSYSTEM:WINDOWS
CC = CL
CFLAGS = /EHsc /openmp
INCS =
LIBS = user32.lib \
Ws2_32.lib \
Mswsock.lib \
kernel32.lib \
Iphlpapi.lib
LFLAGS = /link \
/ENTRY:mainCRTStartup
# Default target
all: clean build
build: objects
$(CC) $(CFLAGS) /Fe$(APPNAME) $(INCS) *.obj $(LIBS) $(LFLAGS) $(CONSOLE_APP)
DEL *.obj
MOVE $(APPNAME).exe bin/$(APPNAME).exe
# Build object files
objects: src/*.c*
$(CC) $(CFLAGS) /c $(INCS) $(CFLAGS) $?
# Clean any leftover build files and executables
clean:
DEL *.exe *.obj
cd bin & DEL *.exe