From ad0d53c9ed34da93d7b9ce96ffaf5570c7c2a95b Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 22 Jun 2010 15:59:04 -0700 Subject: 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 --- win32/Makefile | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'win32') diff --git a/win32/Makefile b/win32/Makefile index af95b2e6..9009ccd0 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 $@ $< -- cgit v1.2.1