/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

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