/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:21:22 UTC
  • Revision ID: edam@waxworlds.org-20090305132122-lwtwrlwj19z7x792
Tags: 1.02
switched compiler to g++

Show diffs side-by-side

added added

removed removed

1
 
#                                                       Edam's Makefile v1.5
2
 
#___________________________________________________________________________
3
 
#                                                            S E T T I N G S
4
 
 
 
1
#
5
2
# Target binary
6
 
TARGET          = helloworld
 
3
#
 
4
TARGET          = simplecrypt
7
5
 
 
6
#
8
7
# All source files
9
 
CC_SRCS         = helloworld.cc
 
8
#
 
9
CC_SRCS         = simplecrypt.cc
10
10
C_SRCS          = 
11
11
S_SRCS          = 
12
12
 
13
 
# Libraries
14
 
LIBRARIES       = 
15
 
 
16
 
# Uncomment for debug-build
17
 
DEBUG           = 1
18
 
 
19
 
#___________________________________________________________________________
20
 
#                                                                    M E A T
21
 
 
22
 
# Software
23
 
AS=nasm
24
 
 
25
 
ifdef DEBUG
26
 
 
27
 
# Debug build flags
28
 
CPPFLAGS        = -g -D DEBUG
29
 
ASFLAGS         = -f elf -g -dDEBUG
30
 
LDFLAGS         = -Wall
31
 
 
32
 
else
33
 
 
34
 
# Release build flags
35
 
CPPFLAGS        = -O2
36
 
ASFLAGS         = -f elf -O2
37
 
LDFLAGS         = -Wall -s
38
 
 
39
 
endif
 
13
#
 
14
# Build flags
 
15
#
 
16
#CFLAGS=-g
 
17
#LDFLAGS=
 
18
 
 
19
 
 
20
#---------------------------------------------------------------------------
 
21
# Edam's makefile r1.02
40
22
 
41
23
# More variables...
42
24
DEPFILE         = Depends
43
 
_SRCS           = $(CC_SRCS) $(C_SRCS) $(S_SRCS)
44
 
_OBJS           = $(addsuffix .o,$(basename $(_SRCS)))
45
 
LDLIBS          = $(addprefix -l,$(LIBRARIES))
 
25
SRCS            = $(C_SRCS) $(CC_SRCS) $(S_SRCS)
 
26
OBJS            = $(addsuffix .o,$(basename $(SRCS)))
46
27
 
47
28
# Main rule...
48
 
$(TARGET): $(_OBJS)
49
 
        g++ -o $(TARGET) $(LDFLAGS) $(_OBJS) $(LDLIBS)
50
 
 
51
 
#___________________________________________________________________________
52
 
#                                                                  R U L E S
53
 
 
54
 
.PHONY: all clean run depend dep
 
29
$(TARGET): $(OBJS)
 
30
        g++ -o $(TARGET) $(OBJS) $(LDFLAGS)
 
31
 
 
32
#---------------------------------------------------------------------------
 
33
 
 
34
.PHONY: all clean depend dep
55
35
 
56
36
all:    clean depend $(TARGET)
57
37
 
58
38
clean:
59
 
        rm -f core $(DEPFILE) $(_OBJS)
 
39
        rm -f core $(DEPFILE) $(OBJS)
60
40
        rm -f *~
61
41
 
62
 
run:    $(TARGET)
63
 
        ./$(TARGET)
64
 
 
65
42
depend dep:
66
 
#       makedepend -f- -- $(CPPFLAGS) -- $(_SRCS) > $(DEPFILE)
 
43
        makedepend -f- -- $(CFLAGS) -- $(SRCS) > $(DEPFILE)
67
44
 
68
 
#___________________________________________________________________________
 
45
#---------------------------------------------------------------------------
69
46
#include $(DEPFILE)