summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'example_app/makefile')
-rw-r--r--example_app/makefile24
1 files changed, 12 insertions, 12 deletions
diff --git a/example_app/makefile b/example_app/makefile
index 6371d48..1b5a5c4 100644
--- a/example_app/makefile
+++ b/example_app/makefile
@@ -2,22 +2,22 @@
2# makefile for ctoolsprof server 2# makefile for ctoolsprof server
3# 3#
4# examples: 4# examples:
5# make debug install 5# make clean debug CC=your-favorite-gcc DESTDIR=your-destination-dir install
6# make release install 6# make clean release CC=your-favorite-gcc DESTDIR=your-destination-dir install
7# make clean debug install 7# To Use CROSS_COMPILE:
8# make clean release install OR make all 8# make clean debug arm DESTDIR=your-destination-dir install
9# make clean release arm DESTDIR=your-destination-dir install
10# make arm all DESTDIR=your-destination-dir
9 11
10ifeq ($(findstring arm, $(MAKECMDGOALS)), arm) 12ifeq ($(findstring arm, $(MAKECMDGOALS)), arm)
11 CC= $(CROSS_COMPILE)gcc --static 13 CC= $(CROSS_COMPILE)gcc
12else
13 CC = gcc
14endif 14endif
15 15
16ifeq ($(findstring debug, $(MAKECMDGOALS)), debug) 16ifeq ($(findstring debug, $(MAKECMDGOALS)), debug)
17 CFLAGS= -std=c99 -c -g -Wall $(INC_PATH) -D DEBUG -D _GNU_SOURCE $(TEST) 17 CFLAGS= -std=c99 -c -g -Wall $(INC_PATH) -D DEBUG -D _GNU_SOURCE
18 OBJDIR= ./debug 18 OBJDIR= ./debug
19else 19else
20 CFLAGS= -std=c99 -c -O2 $(INC_PATH) -D SERVER -D _GNU_SOURCE $(TEST) 20 CFLAGS= -std=c99 -c -O2 $(INC_PATH) -D SERVER -D _GNU_SOURCE
21 OBJDIR= ./release 21 OBJDIR= ./release
22endif 22endif
23LFLAGS = 23LFLAGS =
@@ -27,7 +27,7 @@ INCLUDE_PATH = -I ../example_app
27 27
28.PHONY: clean debug release install arm 28.PHONY: clean debug release install arm
29 29
30all: clean release install 30all: clean release arm install
31 31
32# 32#
33# Declare.c and .h dependencies 33# Declare.c and .h dependencies
@@ -52,7 +52,7 @@ $(OBJDIR)/%.o: %.c
52 52
53ctprof_ex: $(OBJECTS) 53ctprof_ex: $(OBJECTS)
54 @echo "Building target" $@ 54 @echo "Building target" $@
55 $(CC) $(LFLAGS) $(LIBS_PATH) -o $@ $(OBJECTS) $(LIBS) 55 $(CC) $(LFLAGS) $(LIBS_PATH) -o $(OBJDIR)/$@ $(OBJECTS) $(LIBS)
56 56
57debug: ctprof_ex 57debug: ctprof_ex
58 @echo "debug build complete" 58 @echo "debug build complete"
@@ -64,7 +64,7 @@ arm: ctprof_ex
64 @echo "ARM version built" 64 @echo "ARM version built"
65 65
66install: 66install:
67 mv ctprof_ex ~/bin/ctprof_ex 67 mv $(OBJDIR)/ctprof_ex $(DESTDIR)
68 68
69clean: 69clean:
70 -rm $(OBJECTS) 70 -rm $(OBJECTS)