File tree Expand file tree Collapse file tree 8 files changed +51
-62
lines changed Expand file tree Collapse file tree 8 files changed +51
-62
lines changed Original file line number Diff line number Diff line change 1
1
# Makefile for Wirepas C Mesh API example, GNU make version
2
2
3
+ # Variables
4
+
3
5
# This example needs the C Mesh API library
4
6
MESH_LIB_FOLDER := ../lib
5
7
MESH_LIB := $(MESH_LIB_FOLDER ) /build/mesh_api_lib.a
6
8
7
9
# Detect platform and set toolchain variables
8
- include $(MESH_LIB_FOLDER ) /platform .mk
10
+ include $(MESH_LIB_FOLDER ) /tools .mk
9
11
10
12
# Path of source files and build outputs
11
13
SOURCEPREFIX := .
@@ -38,12 +40,12 @@ define COMPILE
38
40
endef
39
41
40
42
define LINK
41
- echo " Linking $(1 ) "
42
- $(CC ) $(CFLAGS ) $( LDFLAGS ) -o $(1 ) $(2 ) $(MESH_LIB )
43
+ echo " LD $(1 ) "
44
+ $(CC ) $(LDFLAGS ) -o $(1 ) $(2 ) $(MESH_LIB )
43
45
endef
44
46
45
47
define CLEAN
46
- echo " Cleaning up "
48
+ echo " CLEAN "
47
49
$(RM ) -r $(BUILDPREFIX )
48
50
endef
49
51
Original file line number Diff line number Diff line change 1
1
# Makefile for Wirepas C Mesh API example, Microsoft NMAKE version
2
2
3
+ # Variables
4
+
3
5
# This example needs the C Mesh API library
4
6
MESH_LIB_FOLDER = ..\lib
5
7
MESH_LIB = $(MESH_LIB_FOLDER ) \build\mesh_api_lib.lib
6
8
7
- # Microsoft Visual studio command line toolchain on Windows
8
- # Use Visual Studio defaults
9
- # CC = cl
10
- # AS = ml
11
-
12
- # Visual Studio C compiler flags
13
- CFLAGS = $(CFLAGS ) /nologo /W4 /WX /O2 /MD /TC
14
-
15
- # Linker flags
16
- LDFLAGS = $(LDFLAGS ) /nologo
17
-
18
- # Platform flags
19
- !MESSAGE Platform : WIN32
20
- PLATFORM_IS_WIN32 = 1
21
- CFLAGS = $(CFLAGS ) /DPLATFORM_IS_WIN32=1
9
+ # Detect platform and set toolchain variables
10
+ !INCLUDE $(MESH_LIB_FOLDER)\tools_msvc.mk
22
11
23
12
# Path of source files and build outputs
24
13
SOURCEPREFIX = .
@@ -53,18 +42,19 @@ all: app
53
42
app : lib $(TARGET_APP )
54
43
55
44
clean :
56
- echo Cleaning up
45
+ echo CLEAN
57
46
-del /F $(OBJECTS ) $(TARGET_APP ) > NUL 2> NUL
58
47
-rmdir /S /Q $(BUILDPREFIX ) > NUL 2> NUL
59
48
60
49
lib :
61
50
cd $(MESH_LIB_FOLDER ) && $(MAKE ) /nologo /f nmake.mk
62
51
63
52
.c.obj :
53
+ echo CC $* .c
64
54
-mkdir $(@D ) > NUL 2> NUL
65
55
$(CC ) $(CFLAGS ) /c /Fo$@ $* .c
66
56
67
57
$(TARGET_APP ) : $(OBJECTS ) $(MESH_LIB )
68
- echo Linking $@
58
+ echo LINK $@
69
59
-mkdir $(@D ) > NUL 2> NUL
70
60
$(CC ) $(LDFLAGS ) /Fe$@ $* *
Original file line number Diff line number Diff line change 3
3
# Variables
4
4
5
5
# Detect platform and set toolchain variables
6
- include platform .mk
6
+ include tools .mk
7
7
8
8
# Path of source files and build outputs
9
9
SOURCEPREFIX := .
@@ -43,12 +43,12 @@ define COMPILE
43
43
endef
44
44
45
45
define LINK_LIB
46
- echo " Linking $(1 ) "
46
+ echo " AR $(1 ) "
47
47
$(ARCHIVE ) $(1 ) $(2 )
48
48
endef
49
49
50
50
define CLEAN
51
- echo " Cleaning up "
51
+ echo " CLEAN "
52
52
$(RM ) -r $(BUILDPREFIX )
53
53
endef
54
54
Original file line number Diff line number Diff line change 2
2
3
3
# Variables
4
4
5
- # Microsoft Visual studio command line toolchain on Windows
6
- # Use Visual Studio defaults
7
- # CC = cl
8
- # AS = ml
9
-
10
- # Visual Studio C compiler flags
11
- CFLAGS = $(CFLAGS ) /nologo /W4 /WX /O2 /MD /TC
12
-
13
- # Linker flags
14
- LDFLAGS = $(LDFLAGS )
15
-
16
- # Platform flags
17
- !MESSAGE Platform : WIN32
18
- PLATFORM_IS_WIN32 = 1
19
- CFLAGS = $(CFLAGS ) /DPLATFORM_IS_WIN32=1
5
+ # Detect platform and set toolchain variables
6
+ !INCLUDE tools_msvc.mk
20
7
21
8
# Path of source files and build outputs
22
9
SOURCEPREFIX = .
@@ -60,15 +47,16 @@ all: lib
60
47
lib : $(TARGET_LIB )
61
48
62
49
clean :
63
- echo Cleaning up
50
+ echo CLEAN
64
51
-del /F $(OBJECTS ) $(TARGET_LIB ) > NUL 2> NUL
65
52
-rmdir /S /Q $(BUILDPREFIX ) > NUL 2> NUL
66
53
67
54
.c.obj :
55
+ echo CC $* .c
68
56
-mkdir $(@D ) > NUL 2> NUL
69
57
$(CC ) $(CFLAGS ) /c /Fo$@ $* .c
70
58
71
59
$(TARGET_LIB ) : $(OBJECTS )
72
- echo Linking $@
60
+ echo LIB $@
73
61
-mkdir $(@D ) > NUL 2> NUL
74
62
lib /NOLOGO /OUT:$@ $* *
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ # Toolchain settings for Wirepas C Mesh API library, Microsoft NMAKE version
2
+
3
+ # Microsoft Visual studio command line toolchain on Windows
4
+ # Use Visual Studio defaults
5
+ # CC = cl
6
+ # AS = ml
7
+
8
+ # Visual Studio C compiler flags
9
+ CFLAGS = $(CFLAGS ) /nologo /W4 /WX /O2 /MD /TC
10
+
11
+ # Linker flags
12
+ LDFLAGS = $(LDFLAGS ) /nologo
13
+
14
+ # Platform flags
15
+ !MESSAGE Platform : WIN32
16
+ PLATFORM_IS_WIN32 = 1
17
+ CFLAGS = $(CFLAGS ) /DPLATFORM_IS_WIN32=1
Original file line number Diff line number Diff line change 1
1
# Makefile for Wirepas C Mesh API test suite, GNU make version
2
2
3
+ # Variables
4
+
3
5
# This example needs the C Mesh API library
4
6
MESH_LIB_FOLDER := ../lib
5
7
MESH_LIB := $(MESH_LIB_FOLDER ) /build/mesh_api_lib.a
6
8
7
9
# Detect platform and set toolchain variables
8
- include $(MESH_LIB_FOLDER ) /platform .mk
10
+ include $(MESH_LIB_FOLDER ) /tools .mk
9
11
10
12
# Path of source files and build outputs
11
13
SOURCEPREFIX := .
@@ -46,12 +48,12 @@ define COMPILE
46
48
endef
47
49
48
50
define LINK
49
- echo " Linking $(1 ) "
50
- $(CC ) $(CFLAGS ) $( LDFLAGS ) -o $(1 ) $(2 ) $(MESH_LIB )
51
+ echo " LD $(1 ) "
52
+ $(CC ) $(LDFLAGS ) -o $(1 ) $(2 ) $(MESH_LIB )
51
53
endef
52
54
53
55
define CLEAN
54
- echo " Cleaning up "
56
+ echo " CLEAN "
55
57
$(RM ) -r $(BUILDPREFIX )
56
58
endef
57
59
Original file line number Diff line number Diff line change 1
1
# Makefile for Wirepas C Mesh API test suite, Microsoft NMAKE version
2
2
3
+ # Variables
4
+
3
5
# This example needs the C Mesh API library
4
6
MESH_LIB_FOLDER = ..\lib
5
7
MESH_LIB = $(MESH_LIB_FOLDER ) \build\mesh_api_lib.lib
6
8
7
- # Microsoft Visual studio command line toolchain on Windows
8
- # Use Visual Studio defaults
9
- # CC = cl
10
- # AS = ml
11
-
12
- # Visual Studio C compiler flags
13
- CFLAGS = $(CFLAGS ) /nologo /W4 /WX /O2 /MD /TC
14
-
15
- # Linker flags
16
- LDFLAGS = $(LDFLAGS ) /nologo
17
-
18
- # Platform flags
19
- !MESSAGE Platform : WIN32
20
- PLATFORM_IS_WIN32 = 1
21
- CFLAGS = $(CFLAGS ) /DPLATFORM_IS_WIN32=1
9
+ # Detect platform and set toolchain variables
10
+ !INCLUDE $(MESH_LIB_FOLDER)\tools_msvc.mk
22
11
23
12
# Path of source files and build outputs
24
13
SOURCEPREFIX = .
@@ -61,18 +50,19 @@ all: app
61
50
app : lib $(TARGET_APP )
62
51
63
52
clean :
64
- echo Cleaning up
53
+ echo CLEAN
65
54
-del /F $(OBJECTS ) $(TARGET_APP ) > NUL 2> NUL
66
55
-rmdir /S /Q $(BUILDPREFIX ) > NUL 2> NUL
67
56
68
57
lib :
69
58
cd $(MESH_LIB_FOLDER ) && $(MAKE ) /nologo /f nmake.mk
70
59
71
60
.c.obj :
61
+ echo CC $* .c
72
62
-mkdir $(@D ) > NUL 2> NUL
73
63
$(CC ) $(CFLAGS ) /c /Fo$@ $* .c
74
64
75
65
$(TARGET_APP ) : $(OBJECTS ) $(MESH_LIB )
76
- echo Linking $@
66
+ echo LINK $@
77
67
-mkdir $(@D ) > NUL 2> NUL
78
68
$(CC ) $(LDFLAGS ) /Fe$@ $* *
You can’t perform that action at this time.
0 commit comments