File: Makefile

package info (click to toggle)
oflib 0git20070620-8
  • links: PTS
  • area: main
  • in suites: buster
  • size: 144 kB
  • sloc: ansic: 751; makefile: 46
file content (40 lines) | stat: -rw-r--r-- 918 bytes parent folder | download | duplicates (3)
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
40
include_dir = $(DESTDIR)/usr/include/ofapi
lib_dir = $(DESTDIR)/usr/lib/$(MULTIARCH_PATH)

LIBNAME = libofapi.so
SONAME = $(LIBNAME).0
SOVERSION = $(SONAME).0.0

CFLAGS += -g -Wall -O2

default:
	gcc $(CFLAGS) -D_REENTRANT -DPIC -fpic  -Wl,-z,relro -Wl,-soname -Wl,$(SONAME) lib/*.c -shared -o $(SOVERSION)

	gcc $(CFLAGS) -c lib/of_externals.c -o lib/of_externals.o
	gcc $(CFLAGS) -c lib/of_internals.c -o lib/of_internals.o
	gcc $(CFLAGS) -c lib/of_standard.c -o lib/of_standard.o

	ar cru libofapi.a lib/*.o
	ranlib libofapi.a

install:
	mkdir -p $(lib_dir)
	cp $(SOVERSION) $(lib_dir)
	cp libofapi.a $(lib_dir)
	ln -sf $(SOVERSION) $(lib_dir)/$(SONAME)
	ln -sf $(SOVERSION) $(lib_dir)/$(LIBNAME)

	mkdir -p $(include_dir)
	cp lib/*.h $(include_dir)

all:
	$(MAKE) default
	$(MAKE) install
	$(MAKE) examples

examples:
	$(MAKE) -C example/

clean:
	$(MAKE) -C example/ clean 
	rm -f $(SOVERSION) lib/*.o libofapi.a