X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=src%2FMakefile;h=9ac890a45cfdd6ce561d86e9fb2a8b03d628ae8f;hb=HEAD;hp=af916c484a3bf875d45d9c53f7c082ccecd428dd;hpb=0a7ead9db7967764f0d93d30f9a83c94cb6fc358;p=rrq%2Fmaintain_lilo.git diff --git a/src/Makefile b/src/Makefile index af916c4..9ac890a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,6 @@ # -*- makefile -*- # -# Copyright 2009-2011 Joachim Wiedorn +# Copyright 2009-2015 Joachim Wiedorn # All rights reserved. # # Licensed under the terms contained in the file 'COPYING' @@ -16,14 +16,13 @@ include ../make.vars SHELL=/bin/sh CC=gcc -CPP=$(CC) -E +CPP=$(CC) -E -P -ffreestanding AS86=as86 -0 -a LD86=ld86 -0 NASM=nasm G=`cat foo1 foo2 | grep version | cut -d " " -f 3` CFLAGS=$(OPT) -Wall $(PCONFIG) -LDFLAGS=#-Xlinker -qmagic LIBS=$(DEVMAPPER) OBJS=lilo.o raid.o map.o geometry.o boot.o device.o common.o bsect.o cfg.o \ @@ -79,7 +78,7 @@ manpath: echo $(MAN_DIR) .c.o: - $(CC) -c $(CFLAGS) $*.c + $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c .s.o: $(AS86) -w -l $*.lis -o $*.o $*.s @@ -91,7 +90,7 @@ manpath: dd if=$*.img of=$*.b bs=32 skip=1 edit: $(EDIT) - $(CC) $(CFLAGS) -DSTANDALONE -o edit $(EDIT) $(LDFLAGS) + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -DSTANDALONE -o edit $(EDIT) loader.i: mkloader first.b second.b third.b bitmap.b mbr.b chain.b mbr2.b ./mkloader >loader.i @@ -100,30 +99,30 @@ disk.com: disk.b cp disk.b disk.com disk.s: disk.S read.S bdata.h biosdata.S lilo.h Makefile - $(CPP) -traditional $(PCONFIG) -o disk.s disk.S + $(CPP) $(CPPFLAGS) -traditional $(PCONFIG) -o disk.s disk.S mbr.s: mbr.S lilo.h Makefile - $(CPP) -traditional $(PCONFIG) -DMBR=0xafbbe760 \ + $(CPP) $(CPPFLAGS) -traditional $(PCONFIG) -DMBR=0xafbbe760 \ -o mbr.s mbr.S mbr.b: mbr.img dd if=$*.img of=$*.b bs=32 skip=49 mbr2.s: mbr.S lilo.h Makefile - $(CPP) -traditional $(PCONFIG) -DMBX=0x93c00848 \ + $(CPP) $(CPPFLAGS) -traditional $(PCONFIG) -DMBX=0x93c00848 \ -o mbr2.s mbr.S mbr2.b: mbr2.img dd if=$*.img of=$*.b bs=32 skip=49 bootsect.s: bootsect.S disk.b - $(CPP) -traditional $(PCONFIG) \ + $(CPP) $(CPPFLAGS) -traditional $(PCONFIG) \ -DSIZEDISKB=`wc -c $(TMP).S - $(CPP) -traditional $(PCONFIG) \ + $(CPP) $(CPPFLAGS) -traditional $(PCONFIG) \ -DSIZEKRNL=`wc -c $(TMP).S - $(CPP) -traditional $(PCONFIG) \ + $(CPP) $(CPPFLAGS) -traditional $(PCONFIG) \ -DSIZEKRNL=`wc -c <../diagnose/test4.com | sed "s/ //g"` \ -DSIZEDISKB=512 -o pseudo2.s $(TMP).S rm -f $(TMP).S @@ -139,7 +138,7 @@ pseudo2.s: bootsect.S pseudo.S pseudo3.s: bootsect.S pseudo.S $(MAKE) -C ../diagnose all cat bootsect.S pseudo.S >$(TMP).S - $(CPP) -traditional $(PCONFIG) \ + $(CPP) $(CPPFLAGS) -traditional $(PCONFIG) \ -DSIZEKRNL=`wc -c <../diagnose/test5.com | sed "s/ //g"` \ -DSIZEDISKB=512 -o pseudo3.s $(TMP).S rm -f $(TMP).S @@ -176,13 +175,13 @@ dparam.s: dparam.S cp -p dparam.S dparam.s lilo: $(OBJS) - $(CC) -o lilo $(LDFLAGS) $(OBJS) $(LIBS) + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o lilo $(OBJS) $(LIBS) lilo.static: $(OBJS) - $(CC) -o lilo.static -static $(LDFLAGS) $(OBJS) $(LIBS) + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o lilo.static -static $(OBJS) $(LIBS) common.s: common.h - $(CPP) -C -traditional -DLILO_ASM -o common.s common.h + $(CPP) $(CPPFLAGS) -C -traditional -DLILO_ASM -o common.s common.h bitmap.o: bitmap.s common.s third.o: third.s common.s @@ -191,25 +190,25 @@ first.o: first.s common.s chain.o: chain.s common.s first.s: first.S lilo.h version.h Makefile - $(CPP) $(PCONFIG) -DFIRST=0x62177489 -o first.s first.S + $(CPP) $(CPPFLAGS) $(PCONFIG) -DFIRST=0x62177489 -o first.s first.S second.s: second.S read.S volume.S mapper.S biosdata.S shs3.S bdata.h lilo.h version.h \ graph.S menu.S strlen.S bitmap.S crt.S display4.S Makefile - $(CPP) $(PCONFIG) -DTEXT=0x9dd476ec second.S -o second.s + $(CPP) $(CPPFLAGS) $(PCONFIG) -DTEXT=0x9dd476ec second.S -o second.s third.s: second.S read.S volume.S mapper.S biosdata.S shs3.S bdata.h lilo.h version.h \ graph.S menu.S strlen.S bitmap.S crt.S display4.S Makefile - $(CPP) $(PCONFIG) -DMENU=0x2012a4a7 second.S -o third.s + $(CPP) $(CPPFLAGS) $(PCONFIG) -DMENU=0x2012a4a7 second.S -o third.s bitmap.s: second.S read.S volume.S mapper.S biosdata.S shs3.S bdata.h lilo.h version.h \ graph.S menu.S strlen.S bitmap.S crt.S display4.S Makefile - $(CPP) $(PCONFIG) -DBITMAP=0x2ece2fbe second.S -o bitmap.s + $(CPP) $(CPPFLAGS) $(PCONFIG) -DBITMAP=0x2ece2fbe second.S -o bitmap.s chain.s: chain.S lilo.h version.h first.b Makefile - $(CPP) $(PCONFIG) -DCHAIN=0x536a7646 chain.S -o chain.s + $(CPP) $(CPPFLAGS) $(PCONFIG) -DCHAIN=0x536a7646 chain.S -o chain.s xxx.s: chain.S lilo.h Makefile - $(CPP) chain.S -DXXX -o xxx.s + $(CPP) $(CPPFLAGS) chain.S -DXXX -o xxx.s $(OBJS): Makefile @@ -243,28 +242,30 @@ install: if [ -f diag1.img ]; then cp -f diag1.img $$DESTDIR$(BOOT_DIR); fi if [ -f diag2.img ]; then cp -f diag2.img $$DESTDIR$(BOOT_DIR); fi + strip lilo cp lilo $$DESTDIR$(SBIN_DIR)/lilo - strip $$DESTDIR$(SBIN_DIR)/lilo + if [ -f lilo.static ]; then \ + strip lilo.static; \ + cp lilo.static $$DESTDIR$(SBIN_DIR)/lilo.static; \ + fi cp ../mkrescue $$DESTDIR$(USRSBIN_DIR)/mkrescue cp ../keytab-lilo.pl $$DESTDIR$(USRSBIN_DIR)/keytab-lilo dep: sed '/\#\#\# Dependencies/q' tmp_make - $(CPP) $(CFLAGS) -MM *.c >>tmp_make + $(CPP) $(CFLAGS) $(CPPFLAGS) -MM *.c >>tmp_make mv tmp_make Makefile version: common.c lilo.h common.h - $(CC) $(CFLAGS) -DSHS_MAIN -o version common.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -DSHS_MAIN -o version common.c mkloader: temp.c - $(CC) $(CFLAGS) -DLILO_BINARY -o mkloader temp.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -DLILO_BINARY -o mkloader temp.c tidy: rm -f core $(LIS) *.shs *.crc $(TMP)* rm -rf sbin boot usr - if [ -x lilo ]; then strip lilo; fi - if [ -x lilo.static ]; then strip lilo.static; fi clean: rm -f *.o *.s *.i *.img *.b tmp_make version