summaryrefslogtreecommitdiffstats
path: root/tools/ddcprobe/Makefile
blob: 468d3464e5a5dbf0f13c8542d8ba2473392a42fb (plain)
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
48
49
50
51
52
53
54
ARCH	:= $(patsubst i%86,i386,$(shell uname -m))
ARCH	:= $(patsubst sparc%,sparc,$(ARCH))
ARCH	:= $(patsubst amd64,x86_64,$(ARCH))

ifeq (i386,$(ARCH))
HAS_VBE	= y
endif
ifeq (x86_64,$(ARCH))
HAS_VBE = y
endif
ifeq (ia64,$(ARCH))
HAS_VBE = y
endif

CC	= gcc
CFLAGS	= -O -Wall # -g -DDEBUG
INCS	= -I.
LDFLAGS	= -lm
ifeq (y,$(HAS_VBE))
LDFLAGS	+= -L. -lint10 -lx86emu
OBJS	= ddcxinfos.o vesamode.o vbe.o
LIBS	= libint10.a libx86emu.a
DEFS	+= -DHAVE_VBE
endif
ifeq (ppc,$(ARCH))
#OBJS	= ddcxinfos.o of.o minifind.o vbe.o vesamode.o
endif
ifeq (ppc64,$(ARCH))
OBJS	= ddcxinfos.o of.o minifind.o vbe.o vesamode.o
endif
ifeq (,$(OBJS))
OBJS	= not_handled.o
endif
CPPFLAGS= $(DEFS)
TARGETS	= ddcxinfos

all: $(TARGETS)

ddcxinfos: $(OBJS) $(LIBS)
	$(CC) -o $@ $(OBJS) $(CFLAGS) $(LDFLAGS)

libx86emu.a: x86emu/*.c
	$(MAKE) -C x86emu

libint10.a: libx86emu.a int10/*.c
	$(MAKE) -C int10

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

clean:
	$(MAKE) -C int10 clean
	$(MAKE) -C x86emu clean
	$(RM) $(TARGETS) $(LIBS) *.o core