File: Makefile

package info (click to toggle)
libx86 1.1%2Bds1-10.2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 988 kB
  • ctags: 1,610
  • sloc: ansic: 20,186; makefile: 69
file content (39 lines) | stat: -rw-r--r-- 912 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
OBJECTS = x86-common.o
CFLAGS ?= -O2 -Wall -DDEBUG -g
LIBDIR ?= /usr/lib
LIBEXECDIR ?= /lib

ifeq ($(BACKEND),x86emu)
	OBJECTS += thunk.o x86emu/decode.o x86emu/debug.o x86emu/fpu.o \
	x86emu/ops.o x86emu/ops2.o x86emu/prim_ops.o x86emu/sys.o
else
	OBJECTS += lrmi.o
endif

ifeq ($(LIBRARY),shared)
	CFLAGS += -fPIC
endif

default:
	$(MAKE) LIBRARY=static static
	$(MAKE) objclean
	$(MAKE) LIBRARY=shared shared

static: $(OBJECTS)
	$(AR) cru libx86.a $(OBJECTS)

shared: $(OBJECTS)
	$(CC) $(CFLAGS) $(LDFLAGS) -o libx86.so.1 -shared -Wl,-soname,libx86.so.1 $(OBJECTS)

objclean:
	$(MAKE) -C x86emu clean
	rm -f *.o *~

clean: objclean
	rm -f *.so.1 *.a

install: libx86.so.1
	install -D libx86.so.1 $(DESTDIR)$(LIBEXECDIR)/libx86.so.1
	install -D libx86.a $(DESTDIR)$(LIBDIR)/libx86.a
	ln -sf $(LIBEXECDIR)/libx86.so.1 $(DESTDIR)$(LIBDIR)/libx86.so
	install -p -m 0644 -D lrmi.h $(DESTDIR)/usr/include/libx86.h