-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (64 loc) · 2.27 KB
/
Copy pathMakefile
File metadata and controls
70 lines (64 loc) · 2.27 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#******************************************************************************
# THIS SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWSIE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#*****************************************************************************
#------------------------------------------------------------------------------
# Simple makefile for the Netcom build system
#
# Use: make [TARGET] [PLATFORM-OVERRIDES] (PLATFORM=x86 / PLATFORM=x64) OR
# mingw32-make.exe [TARGET] [PLATFORM-OVERRIDES] (PLATFORM=x86 / PLATFORM=x64)
#
# Build Targets:
# build - Will build executable
# address-map - Will build c1m2.map file
# <FILE.o> - Will build object files
# compile-all - Will build all object file
# <FILE>.i - Will build preproccessor files
# <FILE>.asm - WIll build assembly files
# <FILE>.d - WIll build dependency files
# clean - removes all generated files
#
# Platform Overrides:
# CPU - HOST
# ARCH - x86 & x64
#------------------------------------------------------------------------------
# Architecture Specific Flags
LINKER_FILE =
CPU = HOST
ARCH = x64
SPECS =
CSTD = c99
#Compiler Flags and Defines
CC = gcc
LD =
BASENAME = netcom
TARGET = $(BASENAME)
MAP = $(BASENAME).map
LDFLAGS = -Wl,-Map=$(MAP)
CFLAGS = -Wall -g
CPPFLAGS = -E
# Files
main_SRCS = *.c
OBJ = $(patsubst %.c, %.o, $(main_SRCS))
PP = $(patsubst %.c, %.i, $(main_SRCS))
ASM = $(main_SRCS).asm
DEP = $(patsubst %.c, DEP.d, $(main_SRCS))
COPY = ./copy.sh
# This phony of build was created to prevent any errors that may occur if there is a file named build
.PHONY : build
ifneq ($(wildcard copy.sh),)
build : $(main_SRCS)
$(CC) $(CFLAGS) $(main_SRCS) -o $(TARGET)
./copy.sh
else
build : $(main_SRCS)
$(CC) $(CFLAGS) $(main_SRCS) -o $(TARGET)
endif
# This phony of clean was created to prevent any errors that may occur if there is a file named clean
.PHONY : clean
clean :
rm -r $(TARGET)