]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - apps/am_sysinfo.git/blob - oprofile_example/makefile
c1ff3b2b1b8ecb307bddda47835a2acd051f555a
[apps/am_sysinfo.git] / oprofile_example / makefile
1 #   ----------------------------------------------------------------------------
2 #  @file   Makefile
3 #
4 #  @path   
5 #
6 #  @desc   Makefile for oprofile_example (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 := signal_parent
37 SRCS :=  signal_parent.c
38 HDRS := 
39 OBJS :=
40 DEBUG :=
41 BIN := signal_parent
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 OBJDIR_D1 := Debug1
53 BINDIR_D1 := $(OBJDIR_D1)
54 OBJS_D1 := $(SRCS:%.c=$(OBJDIR_D1)/%.o)
56 #   ----------------------------------------------------------------------------
57 #   Compiler include directories 
58 #   ----------------------------------------------------------------------------
59 INCLUDES := 
61 #   ----------------------------------------------------------------------------
62 #   All compiler options to be passed to the command line
63 #   ----------------------------------------------------------------------------
64 ALL_CFLAGS := $(INCLUDES)                   \
65               -march=armv5te                \
66               -mtune=arm926ej-s             \
67               -static                       \
68               -c                            \
69               $(CFLAGS)
71 LDFLAGS :=    -march=armv5te                \
72               -mtune=arm926ej-s
74 #   ----------------------------------------------------------------------------
75 #   Compiler symbol definitions 
76 #   ----------------------------------------------------------------------------
77 DEFS :=
79 #   ----------------------------------------------------------------------------
80 #   Compiler and Linker procedure
81 #   From this point and on changes are very unlikely.
82 #   ----------------------------------------------------------------------------
83 .PHONY: all
84 all: debug debug1 release
86 #   ----------------------------------------------------------------------------
87 #   Building Debug... 
88 #   ----------------------------------------------------------------------------
89 .PHONY: debug
90 debug: $(BINDIR_D)/$(BIN)
92 $(BINDIR_D)/$(BIN): $(OBJS_D)
93         @echo Compiling Debug...
94         $(CC) -o $@ $(OBJS_D) $(LIBS_D) $(LDFLAGS)  -Wl,-Map,$(BINDIR_D)/$(NAME).map 
96 $(OBJDIR_D)/%.o : %.c $(HDRS)
97         $(CC) $(ALL_DEBUG) $(DEFS) $(ALL_CFLAGS) -o$@ $<
99 #   ----------------------------------------------------------------------------
100 #   Building Debug... 
101 #   ----------------------------------------------------------------------------
102 .PHONY: debug1
103 debug: $(BINDIR_D1)/$(BIN).opt
105 $(BINDIR_D1)/$(BIN).opt: $(OBJS_D1)
106         @echo Compiling Debug...
107         $(CC) -o $@ $(OBJS_D1) $(LIBS_D) $(LDFLAGS)  -Wl,-Map,$(BINDIR_D1)/$(NAME).map 
109 $(OBJDIR_D1)/%.o : %.c $(HDRS)
110         $(CC) $(ALL_DEBUG) $(DEFS) -DUSE_SIGNALS $(ALL_CFLAGS) -o$@ $<
111 #   ----------------------------------------------------------------------------
112 #   Building Release... 
113 #   ----------------------------------------------------------------------------
115 .PHONY: release
116 release:
118 .PHONY: clean
119 clean:
120         @rm -f $(OBJDIR_D)/*
121         @rm -f $(OBJDIR_D1)/*