]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - apps/am_sysinfo.git/blob - mem_util/makefile
Make default build configuration be Release in CCS project.
[apps/am_sysinfo.git] / mem_util / makefile
1 #   ----------------------------------------------------------------------------
2 #  @file   Makefile
3 #
4 #  @path   
5 #
6 #  @desc   Makefile for mem_util (Debug and Release versions)
7 #
8 #  @ver    1.10
9 #   ----------------------------------------------------------------------------
10 #  Copyright (c) Texas Instruments Incorporated 2002-2009
11 #
12 #  Use of this software is controlled by the terms and conditions found in the
13 #  license agreement under which this software has been supplied or provided.
14 #
16 #   ----------------------------------------------------------------------------
17 #   Included defined variables
18 #   ----------------------------------------------------------------------------
19 -include ../../../Rules.make
21 #   ----------------------------------------------------------------------------
22 #   Variables passed in externally
23 #   ----------------------------------------------------------------------------
24 PLATFORM ?=
25 ARCH ?=
26 CROSS_COMPILE ?=
28 #   ----------------------------------------------------------------------------
29 #   Name of the Linux compiler
30 #   ----------------------------------------------------------------------------
31 CC := $(CROSS_COMPILE)gcc
33 #   ----------------------------------------------------------------------------
34 #   General options, sources and libraries
35 #   ----------------------------------------------------------------------------
36 NAME := mem_util
37 SRCS := mem_util.c
38 HDRS := 
39 OBJS :=
40 DEBUG :=
41 BIN := mem_util.elf
43 #   ----------------------------------------------------------------------------
44 #   Compiler and Linker flags for Debug
45 #   ----------------------------------------------------------------------------
46 OBJDIR_D := Debug
47 BINDIR_D := $(OBJDIR_D)
48 LIBS_D := $(LIBS)
49 OBJS_D := $(SRCS:%.c=$(OBJDIR_D)/%.o)
50 ALL_DEBUG := -g3 -gdwarf-2
52 #   ----------------------------------------------------------------------------
53 #   Compiler and Linker flags for Release
54 #   ----------------------------------------------------------------------------
55 OBJDIR_R := Release
56 BINDIR_R := $(OBJDIR_R)
57 LIBS_R := $(LIBS)
58 OBJS_R := $(SRCS:%.c=$(OBJDIR_R)/%.o)
59 ALL_RELEASE :=
61 #   ----------------------------------------------------------------------------
62 #   Compiler include directories 
63 #   ----------------------------------------------------------------------------
64 INCLUDES := 
66 #   ----------------------------------------------------------------------------
67 #   All compiler options to be passed to the command line
68 #   ----------------------------------------------------------------------------
69 ALL_CFLAGS := $(INCLUDES)                   \
70               -march=armv5te                \
71               -mtune=arm926ej-s             \
72               -c                            \
73               $(CFLAGS)
75 LDFLAGS :=    -march=armv5te                \
76               -mtune=arm926ej-s
78 #   ----------------------------------------------------------------------------
79 #   Compiler symbol definitions 
80 #   ----------------------------------------------------------------------------
81 DEFS :=
83 #   ----------------------------------------------------------------------------
84 #   Compiler and Linker procedure
85 #   From this point and on changes are very unlikely.
86 #   ----------------------------------------------------------------------------
87 .PHONY: all
88 all: debug release
90 #   ----------------------------------------------------------------------------
91 #   Building Debug... 
92 #   ----------------------------------------------------------------------------
93 .PHONY: debug
94 debug: $(BINDIR_D)/$(BIN)
96 $(BINDIR_D)/$(BIN): $(OBJS_D)
97         @echo Compiling Debug...
98         $(CC) -o $@ $(OBJS_D) $(LIBS_D) $(LDFLAGS)  -Wl,-Map,$(BINDIR_D)/$(NAME).map
100 $(OBJDIR_D)/%.o : %.c $(HDRS)
101         $(CC) $(ALL_DEBUG) $(DEFS) $(ALL_CFLAGS) -o$@ $<
103 #   ----------------------------------------------------------------------------
104 #   Building Release... 
105 #   ----------------------------------------------------------------------------
106 .PHONY: release
107 release: $(BINDIR_R)/$(BIN)
109 $(BINDIR_R)/$(BIN): $(OBJS_R)
110         @echo Compiling Release...
111         $(CC) -o $@ $(OBJS_R) $(LIBS_R) $(LDFLAGS) -Wl,-Map,$(BINDIR_R)/$(NAME).map
114 $(OBJDIR_R)/%.o : %.c $(HDRS)
115         $(CC) $(DEFS) $(ALL_RELEASE) $(ALL_CFLAGS) -o$@ $<
117 .PHONY: clean
118 clean:
119         @rm -f $(OBJDIR_D)/*
120         @rm -f $(OBJDIR_R)/*