Home | History | Annotate | Download | only in win64
      1 ## -----------------------------------------------------------------------
      2 ##
      3 ##   Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
      4 ##   Copyright 2010 Intel Corporation; author: H. Peter Anvin
      5 ##
      6 ##   This program is free software; you can redistribute it and/or modify
      7 ##   it under the terms of the GNU General Public License as published by
      8 ##   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
      9 ##   Boston MA 02111-1307, USA; either version 2 of the License, or
     10 ##   (at your option) any later version; incorporated herein by reference.
     11 ##
     12 ## -----------------------------------------------------------------------
     13 
     14 #
     15 # Makefile for SYSLINUX Win64
     16 #
     17 # This is separated out mostly so we can have a different set of Makefile
     18 # variables.
     19 #
     20 
     21 OSTYPE   = $(shell uname -msr)
     22 # Don't know how to do a native compile here...
     23 WINPREFIX  := $(shell $(SRC)/find-mingw64.sh gcc)
     24 WINCFLAGS  := $(GCCWARN) -Wno-sign-compare -Os -fomit-frame-pointer \
     25 	      -D_FILE_OFFSET_BITS=64
     26 WINLDFLAGS := -Os -s
     27 
     28 WINCFLAGS += -I$(SRC) -I$(SRC)/../win -I$(objdir) \
     29 	     -I$(SRC)/../libfat -I$(SRC)/../libinstaller \
     30 	     -I$(SRC)/../libinstaller/getopt
     31 
     32 WINCC      := $(WINPREFIX)gcc
     33 WINAR	   := $(WINPREFIX)ar
     34 WINRANLIB  := $(WINPREFIX)ranlib
     35 
     36 WINCC_IS_GOOD := $(shell $(WINCC) $(WINCFLAGS) $(WINLDFLAGS) \
     37 	-o hello.exe $(SRC)/../win/hello.c >/dev/null 2>&1 ; echo $$?)
     38 
     39 .SUFFIXES: .c .obj .lib .exe .i .s .S
     40 
     41 SRCS     = ../win/syslinux.c ../win/ntfssect.c
     42 OBJS     = $(patsubst %.c,%.obj,$(notdir $(SRCS)))
     43 LIBSRC   = ../libinstaller/fs.c \
     44 	   ../libinstaller/syslxmod.c \
     45 	   ../libinstaller/syslxopt.c \
     46 	   ../libinstaller/setadv.c \
     47 	   ../libinstaller/getopt/getopt_long.c \
     48 	   ../libinstaller/bootsect_bin.c \
     49 	   ../libinstaller/ldlinux_bin.c \
     50 	   ../libinstaller/ldlinuxc32_bin.c \
     51 	   ../libinstaller/mbr_bin.c \
     52 	   $(wildcard $(SRC)/../libfat/*.c)
     53 LIBOBJS  = $(patsubst %.c,%.obj,$(notdir $(LIBSRC)))
     54 
     55 LIB	 = syslinux.lib
     56 
     57 VPATH = $(SRC):$(SRC)/../win:$(SRC)/../libfat:$(SRC)/../libinstaller:$(SRC)/../libinstaller/getopt:$(OBJ)/../libinstaller
     58 
     59 TARGETS = syslinux64.exe
     60 
     61 ifeq ($(WINCC_IS_GOOD),0)
     62 all: $(TARGETS)
     63 else
     64 all:
     65 	rm -f $(TARGETS)
     66 endif
     67 
     68 tidy dist:
     69 	-rm -f *.o *.obj *.lib *.i *.s *.a .*.d *.tmp *_bin.c hello.exe
     70 
     71 clean: tidy
     72 
     73 spotless: clean
     74 	-rm -f *~ $(TARGETS)
     75 
     76 installer:
     77 
     78 $(LIB): $(LIBOBJS)
     79 	rm -f $@
     80 	$(WINAR) cq $@ $^
     81 	$(WINRANLIB) $@
     82 
     83 syslinux64.exe: $(OBJS) $(LIB)
     84 	$(WINCC) $(WINLDFLAGS) -o $@ $^
     85 
     86 
     87 %.obj: %.c
     88 	$(WINCC) $(UMAKEDEPS) $(WINCFLAGS) -c -o $@ $<
     89 %.i: %.c
     90 	$(WINCC) $(UMAKEDEPS) $(WINCFLAGS) -E -o $@ $<
     91 %.s: %.c
     92 	$(WINCC) $(UMAKEDEPS) $(WINCFLAGS) -S -o $@ $<
     93 
     94 -include .*.d
     95