File: Makefile

package info (click to toggle)
v86d 0.1.10-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,024 kB
  • sloc: ansic: 20,683; sh: 128; makefile: 85
file content (47 lines) | stat: -rw-r--r-- 982 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
40
41
42
43
44
45
46
47
config_opt = $(shell if [ -e config.h -a -n "`egrep '^\#define[[:space:]]+$(1)([[:space:]]+|$$)' config.h 2>/dev/null`" ]; then echo true ; fi)

.PHONY: clean install install_testvbe

INSTALL = install

SBINDIR = /usr/sbin

ifeq ($(call config_opt,CONFIG_KLIBC),true)
	export CC = klcc
endif

CFLAGS ?= -Wall -g -O2

LDLIBS += -lx86
V86OBJS = v86_lrmi.o v86_common.o

DEBUG_BUILD =
DEBUG_INSTALL =

ifeq ($(call config_opt,CONFIG_DEBUG),true)
	DEBUG_BUILD += testvbe
	DEBUG_INSTALL += install_testvbe
endif

all: v86d $(DEBUG_BUILD)

%.o: %.c v86.h
	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<

v86d: $(V86OBJS) $(V86LIB) v86.o
	$(CC) $(LDFLAGS) $(V86OBJS) v86.o $(LDLIBS) -o $@

testvbe: $(V86OBJS) $(V86LIB) testvbe.o
	$(CC) $(LDFLAGS) $(V86OBJS) testvbe.o $(LDLIBS) -o $@

clean:
	rm -rf *.o v86d testvbe

distclean: clean
	rm -rf config.h

install: $(DEBUG_INSTALL)
	$(INSTALL) -D v86d $(DESTDIR)$(SBINDIR)/v86d

install_testvbe:
	$(INSTALL) -D testvbe $(DESTDIR)$(SBINDIR)/testvbe