/make/edam-mk

To get this branch, use:
bzr branch http://bzr.ed.am/make/edam-mk

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: edam
  • Date: 2009-03-05 13:25:26 UTC
  • Revision ID: edam@waxworlds.org-20090305132526-n50e3cqq1rhs3zfo
Tags: 1.5
- replaced debug option with debug switch
- added run goal

Show diffs side-by-side

added added

removed removed

1
 
#                                                       Edam's Makefile v1.7
 
1
#                                                       Edam's Makefile v1.5
2
2
#___________________________________________________________________________
3
3
#                                                            S E T T I N G S
4
4
 
11
11
S_SRCS          = 
12
12
 
13
13
# Libraries
14
 
LIBRARIES       =
 
14
LIBRARIES       = 
15
15
 
16
 
# Options (comment-out to disable)
 
16
# Uncomment for debug-build
17
17
DEBUG           = 1
18
 
CPPBUILD        = 1
19
 
#STATICLIBS     = 1
20
 
 
21
 
# Other flags
22
 
CPPFLAGS        = 
23
 
ASFLAGS         = 
24
 
LDFLAGS         = 
25
18
 
26
19
#___________________________________________________________________________
27
20
#                                                                    M E A T
32
25
ifdef DEBUG
33
26
 
34
27
# Debug build flags
35
 
CPPFLAGS        := $(CPPFLAGS) -g -D DEBUG
36
 
ASFLAGS         := -f elf -g -dDEBUG
37
 
LDFLAGS         := -Wall $(if $(STATICLIBS), -static) $(LDFLAGS)
 
28
CPPFLAGS        = -g -D DEBUG
 
29
ASFLAGS         = -f elf -g -dDEBUG
 
30
LDFLAGS         = -Wall
38
31
 
39
32
else
40
33
 
41
34
# Release build flags
42
 
CPPFLAGS        := $(CPPFLAGS) -O2
43
 
ASFLAGS         := -f elf -O2
44
 
LDFLAGS         := -Wall -s $(if $(STATICLIBS), -static) $(LDFLAGS)
 
35
CPPFLAGS        = -O2
 
36
ASFLAGS         = -f elf -O2
 
37
LDFLAGS         = -Wall -s
45
38
 
46
39
endif
47
40
 
53
46
 
54
47
# Main rule...
55
48
$(TARGET): $(_OBJS)
56
 
        $(if $(CPPBUILD), g++, gcc) -o $(TARGET) $(LDFLAGS) $(_OBJS) $(LDLIBS)
 
49
        g++ -o $(TARGET) $(LDFLAGS) $(_OBJS) $(LDLIBS)
57
50
 
58
51
#___________________________________________________________________________
59
52
#                                                                  R U L E S