/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:28:28 UTC
  • Revision ID: edam@waxworlds.org-20090305132828-fbaz7j6st7ualnge
Tags: 1.7
- puled out options to set flags for g++, as and ld

Show diffs side-by-side

added added

removed removed

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