summaryrefslogtreecommitdiffstats
path: root/tools/ddcprobe/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ddcprobe/Makefile')
-rw-r--r--tools/ddcprobe/Makefile63
1 files changed, 44 insertions, 19 deletions
diff --git a/tools/ddcprobe/Makefile b/tools/ddcprobe/Makefile
index bcbf1464d..321c5f4e9 100644
--- a/tools/ddcprobe/Makefile
+++ b/tools/ddcprobe/Makefile
@@ -1,29 +1,54 @@
-CFLAGS=-Wall -O # -g -DDEBUG
-LDFLAGS = -lm
-TARGETS=ddcxinfos
-
-ARCH := $(patsubst i%86,i386,$(shell uname -m))
-ARCH := $(patsubst sparc%,sparc,$(ARCH))
+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
-ddcxinfos: lrmi.o vesamode.o vbe.o ddcxinfos.o
+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
-libvbe.a: lrmi.o vesamode.o vbe.o
- $(AR) cru $@ $^
+all: $(TARGETS)
-#install: $(DESTDIR)/usr/include/vbe.h $(DESTDIR)/usr/lib/libvbe.a
+ddcxinfos: $(OBJS) $(LIBS)
+ $(CC) -o $@ $(OBJS) $(CFLAGS) $(LDFLAGS)
-$(DESTDIR)/usr/include/vbe.h:
- install -m 644 vbe.h $(DESTDIR)/usr/include/vbe.h
+libx86emu.a: x86emu/*.c
+ $(MAKE) -C x86emu
-$(DESTDIR)/usr/lib/libvbe.a:
- install -m 644 libvbe.a $(DESTDIR)/usr/lib/libvbe.a
+libint10.a: libx86emu.a int10/*.c
+ $(MAKE) -C int10
-else
-ddcxinfos: not_handled.c
- gcc -o $@ $<
-endif
+%.o: %.c
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCS) -c $< -o $@
clean:
- $(RM) $(TARGETS) *.o core
+ $(MAKE) -C int10 clean
+ $(MAKE) -C x86emu clean
+ $(RM) $(TARGETS) $(LIBS) *.o core