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
|
# Edam's Makefile v1.5
#___________________________________________________________________________
# S E T T I N G S
# Target binary
TARGET = helloworld
# All source files
CC_SRCS = helloworld.cc
C_SRCS =
S_SRCS =
# Libraries
LIBRARIES =
# Uncomment for debug-build
DEBUG = 1
#___________________________________________________________________________
# M E A T
# Software
AS=nasm
ifdef DEBUG
# Debug build flags
CPPFLAGS = -g -D DEBUG
ASFLAGS = -f elf -g -dDEBUG
LDFLAGS = -Wall
else
# Release build flags
CPPFLAGS = -O2
ASFLAGS = -f elf -O2
LDFLAGS = -Wall -s
endif
# More variables...
DEPFILE = Depends
_SRCS = $(CC_SRCS) $(C_SRCS) $(S_SRCS)
_OBJS = $(addsuffix .o,$(basename $(_SRCS)))
LDLIBS = $(addprefix -l,$(LIBRARIES))
# Main rule...
$(TARGET): $(_OBJS)
g++ -o $(TARGET) $(LDFLAGS) $(_OBJS) $(LDLIBS)
#___________________________________________________________________________
# R U L E S
.PHONY: all clean run depend dep
all: clean depend $(TARGET)
clean:
rm -f core $(DEPFILE) $(_OBJS)
rm -f *~
run: $(TARGET)
./$(TARGET)
depend dep:
# makedepend -f- -- $(CPPFLAGS) -- $(_SRCS) > $(DEPFILE)
#___________________________________________________________________________
#include $(DEPFILE)
|