File: Makefile

package info (click to toggle)
git 1%3A2.47.3-0%2Bdeb13u1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 59,700 kB
  • sloc: ansic: 298,483; sh: 255,583; perl: 29,458; tcl: 22,173; makefile: 4,235; python: 3,442; javascript: 772; awk: 47; csh: 45; ruby: 43; lisp: 12
file content (39 lines) | stat: -rw-r--r-- 1,183 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#
# Copyright (c) Vicent Marti. All rights reserved.
#
# This file is part of clar, distributed under the ISC license.
# For full terms see the included COPYING file.
#

#
# Set up the path to the clar sources and to the fixtures directory
#
# The fixture path needs to be an absolute path so it can be used
# even after we have chdir'ed into the test directory while testing.
#
CURRENT_MAKEFILE  := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
TEST_DIRECTORY    := $(abspath $(dir $(CURRENT_MAKEFILE)))
CLAR_PATH         := $(dir $(TEST_DIRECTORY))
CLAR_FIXTURE_PATH := $(TEST_DIRECTORY)/resources/

CFLAGS=-g -I.. -I. -Wall -DCLAR_FIXTURE_PATH=\"$(CLAR_FIXTURE_PATH)\"

.PHONY: clean

# list the objects that go into our test
objects = main.o sample.o

# build the test executable itself
clar_test: $(objects) clar_test.h clar.suite $(CLAR_PATH)clar.c
	$(CC) $(CFLAGS) -o $@ "$(CLAR_PATH)clar.c" $(objects)

# test object files depend on clar macros
$(objects) : $(CLAR_PATH)clar.h

# build the clar.suite file of test metadata
clar.suite:
	python "$(CLAR_PATH)generate.py" .

# remove all generated files
clean:
	$(RM) -rf *.o clar.suite .clarcache clar_test clar_test.dSYM