2
2
#___________________________________________________________________________
20
CPPFLAGS = $(DEBUG) -O2
21
ASFLAGS = $(DEBUG) -f elf
22
LDFLAGS = $(DEBUG) -Wall -s -nostartfiles
16
# Override options (better: specify in environment or on cmdline)
24
27
#___________________________________________________________________________
31
CC := $(if $(CPPBUILD), g++, gcc)
36
CPPFLAGS := -g -D DEBUG $(CPPFLAGS)
37
ASFLAGS := -f elf -g -dDEBUG $(ASFLAGS)
38
LDFLAGS := -Wall $(if $(STATICLIBS), -static) $(LDFLAGS)
43
CPPFLAGS := -O2 $(CPPFLAGS)
44
ASFLAGS := -f elf -O2 $(ASFLAGS)
45
LDFLAGS := -Wall -s $(if $(STATICLIBS), -static) $(LDFLAGS)
30
49
# More variables...
32
_SRCS = $(CC_SRCS) $(C_SRCS) $(S_SRCS)
33
_OBJS = $(addsuffix .o,$(basename $(_SRCS)))
34
LDLIBS = $(addprefix -l,$(LIBRARIES))
51
_SRCS := $(CC_SRCS) $(C_SRCS) $(S_SRCS)
52
_OBJS := $(addsuffix .o,$(basename $(_SRCS)))
53
LDLIBS := $(addprefix -l,$(LIBRARIES))
55
.PHONY: all clean run depend dep
37
59
$(TARGET): $(_OBJS)
38
gcc -o $(TARGET) $(LDFLAGS) $(_OBJS) $(LDLIBS)
40
#___________________________________________________________________________
43
.PHONY: all clean depend dep
45
all: clean depend $(TARGET)
61
$(AR) rcs $(TARGET) $(_OBJS)
63
$(CC) -o $(TARGET) $(LDFLAGS) $(LDLIBS) $(_OBJS)
48
67
rm -f core $(DEPFILE) $(_OBJS)
52
74
# makedepend -f- -- $(CPPFLAGS) -- $(_SRCS) > $(DEPFILE)