newlib/winsup/w32api/lib/Makefile.in

279 lines
6.7 KiB
Makefile
Raw Normal View History

2000-02-17 20:38:33 +01:00
#
# Makefile.in
#
# This file is part of a free library for the Win32 API.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# start config section
SHELL = @SHELL@
srcdir = @srcdir@
VPATH = @srcdir@
SUBDIRS := ddk directx
subdirs := ddk directx
host_alias = @host@
build_alias = @build@
target_alias = @target@
2000-02-17 20:38:33 +01:00
prefix = @prefix@
includedir:=@includedir@
2000-02-17 20:38:33 +01:00
program_transform_name = @program_transform_name@
exec_prefix = @exec_prefix@
libdir:=@libdir@
2000-02-17 20:38:33 +01:00
bindir = @bindir@
ifeq ($(target_alias),$(host_alias))
ifeq ($(build_alias),$(host_alias))
tooldir:=$(exec_prefix)
else
tooldir:=$(exec_prefix)/$(target_alias)
endif
else
tooldir:=$(exec_prefix)/$(target_alias)
endif
2000-02-17 20:38:33 +01:00
datadir = @datadir@
infodir = @infodir@
ifneq (,$(findstring cygwin,$(target_alias)))
inst_includedir:=$(tooldir)/include/w32api
inst_libdir:=$(tooldir)/lib/w32api
else
inst_includedir:=$(includedir)
inst_libdir:=$(libdir)
endif
2000-02-17 20:38:33 +01:00
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
mkinstalldirs = mkdir -p
CC = @CC@
CC_FOR_TARGET = $(CC)
DLLTOOL = @DLLTOOL@
DLLTOOL_FLAGS = --as=$(AS) -k
AS = @AS@
AS_FOR_TARGET = $(AS_FOR_TARGET)
WINDRES = @WINDRES@
# Depending on if we build as part of winsup or mingw we need to
# add additional include paths in order to get the correct headers
# from the C library.
BUILDENV = @BUILDENV@
ifeq ($(BUILDENV), cygwin)
# winsup/include
# winsup/../newlib/libc/include
# winsup/../newlib/libc/sys/cygwin
EXTRA_INCLUDES = -I$(srcdir)/../../include -I$(srcdir)/../../../newlib/libc/include -I$(srcdir)/../../../newlib/libc/sys/cygwin
endif
ifeq ($(BUILDENV), mingw)
EXTRA_INCLUDES = -I$(srcdir)/../../mingw/include
endif
INCLUDES = -I$(srcdir)/../include $(EXTRA_INCLUDES)
CFLAGS = @CFLAGS@
ALL_CFLAGS = $(CFLAGS) $(INCLUDES)
RANLIB = @RANLIB@
AR = @AR@
LD = @LD@
FLAGS_TO_PASS = \
AS="$(AS)" \
CC="$(CC)" \
CPPFLAGS="$(CPPFLAGS)" \
CFLAGS="$(CFLAGS)" \
CXXFLAGS="$(CXXFLAGS)" \
AR="$(AR)" \
RANLIB="$(RANLIB)" \
LD="$(LD)" \
DLLTOOL="$(DLLTOOL)" \
TAR="$(TAR)" \
TARFLAGS="$(TARFLAGS)" \
TARFILEEXT="$(TARFILEEXT)" \
WINDRES="$(WINDRES)"
2000-02-17 20:38:33 +01:00
# end config section
# headers
HEADERS = $(notdir $(wildcard $(srcdir)/../include/*.h))
2002-05-28 15:20:28 +02:00
GL_HEADERS = $(notdir $(wildcard $(srcdir)/../include/GL/*.h))
2000-02-17 20:38:33 +01:00
# libraries
DEF_FILES = $(notdir $(wildcard $(srcdir)/*.def))
MRI_FILES = $(notdir $(wildcard $(srcdir)/*.mri))
2000-02-17 20:38:33 +01:00
IMPLIBS = $(addprefix lib,$(subst .def,.a,$(DEF_FILES)))
MIMPLIBS = $(addprefix lib,$(subst .mri,.a,$(MRI_FILES)))
EXTRA_LIBS=libuuid.a libscrnsave.a libscrnsavw.a liblargeint.a
LIBS = $(IMPLIBS) $(MIMPLIBS) $(EXTRA_LIBS)
UUID_OBJS = uuid.o mshtml-uuid.o msxml-uuid.o unknwn-uuid.o \
servprov-uuid.o oleidl-uuid.o oleacc-uuid.o ocidl-uuid.o
EXTRA_OBJS = shell32.o scrnsave.o scrnsavw.o largeint.o \
$(UUID_OBJS) kernel32.o ws2_32.o
UUID_SOURCES = uuid.c mshtml-uuid.c msxml-uuid.c unknwn-uuid.c \
servprov-uuid.c oleidl-uuid.c oleacc-uuid.c ocidl-uuid.c
SOURCES = scrnsave.c shell32.c largeint.c $(UUID_SOURCES)\
res.rc test.c kernel32.c ws2_32.c
2000-02-17 20:38:33 +01:00
DISTFILES = Makefile.in $(DEF_FILES) $(MRI_FILES) $(SOURCES)
2000-02-17 20:38:33 +01:00
.NOTPARALLEL:
2000-02-17 20:38:33 +01:00
# targets
all: $(LIBS) $(EXTRA_OBJS) ddk directx
%-subdirs:
for i in $(SUBDIRS); do \
$(MAKE) $(FLAGS_TO_PASS) -C $$i $*; \
done
ddk:
$(MAKE) $(FLAGS_TO_PASS) -C $@
2000-02-17 20:38:33 +01:00
directx:
$(MAKE) $(FLAGS_TO_PASS) -C $@
TEST_OPTIONS = $(ALL_CFLAGS) -DWINVER=0x0666 \
-Wall -pedantic -Wsystem-headers -c $(srcdir)/test.c -o test.o
.PHONY: test ddk directx
2000-02-17 20:38:33 +01:00
test:
@echo "Testing w32api..."
@for lang in c c++ objective-c ; do \
echo "$$lang..."; \
$(CC) -x$$lang $(TEST_OPTIONS) ; \
echo "$$lang UNICODE..."; \
$(CC) -x$$lang -DUNICODE $(TEST_OPTIONS) ; \
done
@echo "windres..."
@$(WINDRES) --include-dir $(INCDIR) -i $(srcdir)/res.rc -o test.o
@echo "windres UNICODE..."
@$(WINDRES) --define UNICODE --include-dir $(INCDIR) -i $(srcdir)/res.rc -o test.o
@rm -f test.o
scrnsavw.o: scrnsave.c
$(CC) -c $(ALL_CFLAGS) -DUNICODE -o $@ $<
# make rules
.SUFFIXES: .c .o .def .a
.c.o:
$(CC) -c $(ALL_CFLAGS) -o $@ $<
libuuid.a : $(UUID_OBJS)
$(AR) rc $@ $(UUID_OBJS)
$(RANLIB) $@
# libvfw32.a contains import stubs for 3 dll's. Using an MRI script
# seems to be the simplest way to combine them into one archive.
# NB: With older dlltool, the object file members will not have unique
# names.
libvfw32.a : vfw32.mri libmsvfw32.a libavifil32.a libavicap32.a
rm -f $@
$(AR) -M < ${word 1,$^}
$(RANLIB) $@
2000-02-17 20:38:33 +01:00
lib%.a : %.def %.o
$(DLLTOOL) $(DLLTOOL_FLAGS) --output-lib $@ --def $(srcdir)/$*.def
$(AR) r $@ $*.o
$(RANLIB) $@
lib%.a: %.def
$(DLLTOOL) $(DLLTOOL_FLAGS) --output-lib $@ --def $<
lib%.a: %.o
$(AR) rc $@ $*.o
$(RANLIB) $@
.PHONY: install install-libraries install-headers install-ddk
2000-10-20 06:39:21 +02:00
# install headers and libraries in a target specified directory.
install: install-libraries install-headers install-ddk install-directx
2000-10-20 06:39:21 +02:00
install-libraries: all
$(mkinstalldirs) $(inst_libdir)
2000-10-20 06:39:21 +02:00
for i in $(LIBS); do \
$(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \
2000-10-20 06:39:21 +02:00
done
install-headers:
$(mkinstalldirs) $(inst_includedir)
2000-10-20 06:39:21 +02:00
for i in $(HEADERS); do \
$(INSTALL_DATA) $(srcdir)/../include/$$i $(inst_includedir)/$$i ; \
2000-10-20 06:39:21 +02:00
done
2002-05-28 15:20:28 +02:00
$(mkinstalldirs) $(inst_includedir)/GL
for i in $(GL_HEADERS); do \
$(INSTALL_DATA) $(srcdir)/../include/GL/$$i $(inst_includedir)/GL/$$i ; \
done
2000-10-20 06:39:21 +02:00
install-ddk: install-libraries install-headers
cd ddk && $(MAKE) install $(FLAGS_TO_PASS)
install-directx: install-libraries install-headers
cd directx && $(MAKE) install $(FLAGS_TO_PASS)
# uninstall headers and libraries from a target specified directory
uninstall: uninstall-ddk uninstall-directx uninstall-libraries uninstall-headers
2000-02-17 20:38:33 +01:00
uninstall-libraries:
@for i in $(LIBS); do \
rm -f $(inst_libdir)/$$i ; \
2000-02-17 20:38:33 +01:00
done
rmdir $(inst_libdir)
2000-02-17 20:38:33 +01:00
uninstall-headers:
@for i in $(HEADERS); do \
rm -r $(inst_includedir)/$$i ; \
2000-02-17 20:38:33 +01:00
done
rmdir $(inst_includedir)
2000-02-17 20:38:33 +01:00
uninstall-ddk:
cd ddk && $(MAKE) -C uninstall $(FLAGS_TO_PASS)
uninstall-directx:
cd directx && $(MAKE) -C uninstall $(FLAGS_TO_PASS)
2000-02-17 20:38:33 +01:00
dist:
mkdir $(distdir)/include
chmod 755 $(distdir)/include
@for i in $(HEADERS); do \
cp -p $(srcdir)/../include/$$i $(distdir)/include/$$i ; \
done
mkdir $(distdir)/include/GL
@for i in $(GL_HEADERS); do \
cp -p $(srcdir)/../include/GL/$$i $(distdir)/include/GL/$$i ; \
done
2000-02-17 20:38:33 +01:00
mkdir $(distdir)/lib
chmod 755 $(distdir)/lib
@for i in $(DISTFILES); do \
cp -p $(srcdir)/$$i $(distdir)/lib/$$i ; \
done
for i in $(SUBDIRS); do \
(cd $$i; $(MAKE) distdir=../$(distdir) dist); \
done
2000-02-17 20:38:33 +01:00
Makefile: Makefile.in ../config.status ../configure
cd ..; $(SHELL) config.status
# clean
mostlyclean:
rm -f *~ *.o *.s
clean:
rm -f *.o *.a *.s *~
distclean: clean
rm -f config.cache config.status config.log Makefile
maintainer-clean: distclean