/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:26:41 UTC
  • Revision ID: edam@waxworlds.org-20090305132641-42u18q8sg2lx966x
Tags: 1.6
- added cpp build switch
- added static linking switch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#                                                       Edam's Makefile v1.5
 
1
#                                                       Edam's Makefile v1.6
2
2
#___________________________________________________________________________
3
3
#                                                            S E T T I N G S
4
4
 
5
5
# Target binary
6
 
TARGET          = helloworld
 
6
TARGET          = groups
7
7
 
8
8
# All source files
9
 
CC_SRCS         = helloworld.cc
10
 
C_SRCS          = 
 
9
CC_SRCS         =
 
10
C_SRCS          = groups.c xmalloc.c
11
11
S_SRCS          = 
12
12
 
13
13
# Libraries
14
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
18
20
 
19
21
#___________________________________________________________________________
20
22
#                                                                    M E A T
27
29
# Debug build flags
28
30
CPPFLAGS        = -g -D DEBUG
29
31
ASFLAGS         = -f elf -g -dDEBUG
30
 
LDFLAGS         = -Wall
 
32
LDFLAGS         = -Wall $(if $(STATICLIBS), -static)
31
33
 
32
34
else
33
35
 
34
36
# Release build flags
35
37
CPPFLAGS        = -O2
36
38
ASFLAGS         = -f elf -O2
37
 
LDFLAGS         = -Wall -s
 
39
LDFLAGS         = -Wall -s $(if $(STATICLIBS), -static)
38
40
 
39
41
endif
40
42
 
46
48
 
47
49
# Main rule...
48
50
$(TARGET): $(_OBJS)
49
 
        g++ -o $(TARGET) $(LDFLAGS) $(_OBJS) $(LDLIBS)
 
51
        $(if $(CPPBUILD), g++, gcc) -o $(TARGET) $(LDFLAGS) $(_OBJS) $(LDLIBS)
50
52
 
51
53
#___________________________________________________________________________
52
54
#                                                                  R U L E S