/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:23:20 UTC
  • Revision ID: edam@waxworlds.org-20090305132320-hjmtab4k0hr9i147
Tags: 1.3
- added propper header
- added debug options
- added libraries option
- added (currently unused) dependencies

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#                                                       Edam's Makefile v1.6
 
1
#                                                       Edam's Makefile v1.3
2
2
#___________________________________________________________________________
3
3
#                                                            S E T T I N G S
4
4
 
5
5
# Target binary
6
 
TARGET          = groups
 
6
TARGET          = exectest
7
7
 
8
8
# All source files
9
 
CC_SRCS         =
10
 
C_SRCS          = groups.c xmalloc.c
11
 
S_SRCS          = 
 
9
CC_SRCS         = 
 
10
C_SRCS          = 
 
11
S_SRCS          = exectest.s
12
12
 
13
13
# Libraries
14
14
LIBRARIES       = 
15
15
 
16
 
# Options (comment-out to disable)
17
 
DEBUG           = 1
18
 
#CPPBUILD       = 1
19
 
#STATICLIBS     = 1
 
16
# Debug?
 
17
DEBUG           = -g
 
18
 
 
19
# Build flags
 
20
CPPFLAGS        = $(DEBUG) -O2
 
21
ASFLAGS         = $(DEBUG) -f elf
 
22
LDFLAGS         = $(DEBUG) -Wall -s -nostartfiles
20
23
 
21
24
#___________________________________________________________________________
22
25
#                                                                    M E A T
24
27
# Software
25
28
AS=nasm
26
29
 
27
 
ifdef DEBUG
28
 
 
29
 
# Debug build flags
30
 
CPPFLAGS        = -g -D DEBUG
31
 
ASFLAGS         = -f elf -g -dDEBUG
32
 
LDFLAGS         = -Wall $(if $(STATICLIBS), -static)
33
 
 
34
 
else
35
 
 
36
 
# Release build flags
37
 
CPPFLAGS        = -O2
38
 
ASFLAGS         = -f elf -O2
39
 
LDFLAGS         = -Wall -s $(if $(STATICLIBS), -static)
40
 
 
41
 
endif
42
 
 
43
30
# More variables...
44
31
DEPFILE         = Depends
45
32
_SRCS           = $(CC_SRCS) $(C_SRCS) $(S_SRCS)
48
35
 
49
36
# Main rule...
50
37
$(TARGET): $(_OBJS)
51
 
        $(if $(CPPBUILD), g++, gcc) -o $(TARGET) $(LDFLAGS) $(_OBJS) $(LDLIBS)
 
38
        gcc -o $(TARGET) $(LDFLAGS) $(_OBJS) $(LDLIBS)
52
39
 
53
40
#___________________________________________________________________________
54
41
#                                                                  R U L E S
55
42
 
56
 
.PHONY: all clean run depend dep
 
43
.PHONY: all clean depend dep
57
44
 
58
45
all:    clean depend $(TARGET)
59
46
 
61
48
        rm -f core $(DEPFILE) $(_OBJS)
62
49
        rm -f *~
63
50
 
64
 
run:    $(TARGET)
65
 
        ./$(TARGET)
66
 
 
67
51
depend dep:
68
52
#       makedepend -f- -- $(CPPFLAGS) -- $(_SRCS) > $(DEPFILE)
69
53