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
|
# Edam's Makefile v1.3
#___________________________________________________________________________
# S E T T I N G S
# Target binary
TARGET = exectest
# All source files
CC_SRCS =
C_SRCS =
S_SRCS = exectest.s
# Libraries
LIBRARIES =
# Debug?
DEBUG = -g
# Build flags
CPPFLAGS = $(DEBUG) -O2
ASFLAGS = $(DEBUG) -f elf
LDFLAGS = $(DEBUG) -Wall -s -nostartfiles
#___________________________________________________________________________
# M E A T
# Software
AS=nasm
# More variables...
DEPFILE = Depends
_SRCS = $(CC_SRCS) $(C_SRCS) $(S_SRCS)
_OBJS = $(addsuffix .o,$(basename $(_SRCS)))
LDLIBS = $(addprefix -l,$(LIBRARIES))
# Main rule...
$(TARGET): $(_OBJS)
gcc -o $(TARGET) $(LDFLAGS) $(_OBJS) $(LDLIBS)
#___________________________________________________________________________
# R U L E S
.PHONY: all clean depend dep
all: clean depend $(TARGET)
clean:
rm -f core $(DEPFILE) $(_OBJS)
rm -f *~
depend dep:
# makedepend -f- -- $(CPPFLAGS) -- $(_SRCS) > $(DEPFILE)
#___________________________________________________________________________
#include $(DEPFILE)
|