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