File: Makefile

package info (click to toggle)
libsemanage 1.8-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,556 kB
  • ctags: 2,120
  • sloc: ansic: 21,308; python: 1,242; yacc: 270; sh: 191; makefile: 136; lex: 70
file content (32 lines) | stat: -rw-r--r-- 842 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
# Add your test source files here:
SOURCES = $(wildcard *.c)

# Point this variable to the libsemanage source directory you want to test:
TESTSRC=../src

# Add the required external object files here:
LIBS = ../src/libsemanage.a ../../libselinux/src/libselinux.a ../../libsepol/src/libsepol.a

###########################################################################

EXECUTABLE = libsemanage-tests
CC = gcc
CFLAGS = -c -g -o0 -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
INCLUDE = -I$(TESTSRC) -I$(TESTSRC)/../include/semanage
LDFLAGS = -lcunit
OBJECTS = $(SOURCES:.c=.o) 

all: $(EXECUTABLE) 

$(EXECUTABLE): $(OBJECTS) 
	$(CC) $(OBJECTS) $(LIBS) $(LDFLAGS) -o $@

%.o: %.c
	$(CC) $(CFLAGS) $(INCLUDE) $*.c -o $*.o

clean distclean: 
	rm -rf $(OBJECTS) $(EXECUTABLE)

test: all 
	./$(EXECUTABLE)