-
Notifications
You must be signed in to change notification settings - Fork 13
/
nmake.mk
36 lines (28 loc) · 941 Bytes
/
nmake.mk
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
# generic nmake Makefile (without dependencies)
all: subprojects checkdirs output_binary output_library
clean:
@if exist $(BUILD_DIR) rmdir /S /Q $(BUILD_DIR)
! ifdef SUBPRJS
@echo off && for %%x in ($(SUBPRJS)) do cd %%x && $(MAKE) /NOLOGO clean
! endif
checkdirs:
@if NOT EXIST $(BUILD_DIR) mkdir $(BUILD_DIR)
{$(SRC_DIR)}.cpp{$(BUILD_DIR)}.obj::
$(CC) -nologo $(INCLUDES) -c /O2 /W4 /EHsc /Fo$(BUILD_DIR)/ $<
subprojects:
! ifdef SUBPRJS
@echo off && for %%x in ($(SUBPRJS)) do cd %%x && $(MAKE) /NOLOGO
! endif
output_binary: $(PATH_BIN)
! ifdef PATH_BIN
$(PATH_BIN): $(BUILD_DIR)/*.obj
LINK /NOLOGO /OUT:$(PATH_BIN) $(BUILD_DIR)/*.obj $(LIBS)
! endif
! ifndef OUT_LIB
output_library:
! else
output_library: $(BUILD_DIR)/$(OUT_LIB)
INCLUDES = $(INCLUDES) -Iinclude
$(BUILD_DIR)/$(OUT_LIB): $(BUILD_DIR)/*.obj
LIB /NOLOGO /VERBOSE /OUT:$(BUILD_DIR)/$(OUT_LIB) $(BUILD_DIR)/*.obj
! endif