[syslinux:master] win32: use .obj not .o, and build an intermediate library

syslinux-bot for H. Peter Anvin hpa at linux.intel.com
Tue Jun 22 16:03:11 PDT 2010


Commit-ID:  ad0d53c9ed34da93d7b9ce96ffaf5570c7c2a95b
Gitweb:     http://syslinux.zytor.com/commit/ad0d53c9ed34da93d7b9ce96ffaf5570c7c2a95b
Author:     H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Tue, 22 Jun 2010 15:59:04 -0700
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Tue, 22 Jun 2010 15:59:04 -0700

win32: use .obj not .o, and build an intermediate library

Use .obj as the extension, rather than .o, to match Windows
conventions.  Furthermore, build an intermediate library for the stuff
that we pick up from elsewhere; this makes it easier to build
additional Windows binaries with helper functions in libinstaller or
another source library.

Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>


---
 win32/Makefile |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/win32/Makefile b/win32/Makefile
index af95b2e..9009ccd 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -1,6 +1,7 @@
 ## -----------------------------------------------------------------------
 ##
 ##   Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
+##   Copyright 2010 Intel Corporation; author: H. Peter Anvin
 ##
 ##   This program is free software; you can redistribute it and/or modify
 ##   it under the terms of the GNU General Public License as published by
@@ -44,14 +45,17 @@ WINCC_IS_GOOD := $(shell $(WINCC) $(WINCFLAGS) $(WINLDFLAGS) -o hello.exe hello.
 
 .SUFFIXES: .c .o .i .s .S
 
-SRCS     = syslinux.c \
-	   ../libinstaller/fat.c \
+SRCS     = syslinux.c
+OBJS     = $(patsubst %.c,%.obj,$(notdir $(SRCS)))
+LIBSRC   = ../libinstaller/fat.c \
 	   ../libinstaller/syslxmod.c \
 	   ../libinstaller/bootsect_bin.c \
 	   ../libinstaller/ldlinux_bin.c \
 	   ../libinstaller/mbr_bin.c \
 	   $(wildcard ../libfat/*.c)
-OBJS     = $(patsubst %.c,%.o,$(notdir $(SRCS)))
+LIBOBJS  = $(patsubst %.c,%.obj,$(notdir $(LIBSRC)))
+
+LIB	 = syslinux.lib
 
 VPATH = .:../libfat:../libinstaller
 
@@ -65,7 +69,7 @@ all:
 endif
 
 tidy dist:
-	-rm -f *.o *.i *.s *.a .*.d *.tmp *_bin.c hello.exe
+	-rm -f *.o *.obj *.lib *.i *.s *.a .*.d *.tmp *_bin.c hello.exe
 
 clean: tidy
 
@@ -74,11 +78,15 @@ spotless: clean
 
 installer:
 
-syslinux.exe: $(OBJS)
+$(LIB): $(LIBOBJS)
+	$(WINAR) cq $@ $^
+	$(WINRANLIB) $@
+
+syslinux.exe: $(OBJS) $(LIB)
 	$(WINCC) $(WINLDFLAGS) -o $@ $^
 
 
-%.o: %.c
+%.obj: %.c
 	$(WINCC) $(UMAKEDEPS) $(WINCFLAGS) -c -o $@ $<
 %.i: %.c
 	$(WINCC) $(UMAKEDEPS) $(WINCFLAGS) -E -o $@ $<



More information about the Syslinux-commits mailing list