# -*- makefile -*-
+#
+# Copyright 2009-2013 Joachim Wiedorn
+# All rights reserved.
+#
+# Licensed under the terms contained in the file 'COPYING'
+# in the source directory.
+#
# adding variables
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 -g $(PCONFIG)
+CFLAGS=$(OPT) -Wall $(PCONFIG)
LDFLAGS=#-Xlinker -qmagic
LIBS=$(DEVMAPPER)
EDIT=edit.c common.o
-LIS=chain.lis disk.lis dparam.lis os2_d.lis first.lis second.lis \
+LIS=chain.lis disk.lis dparam.lis first.lis second.lis \
bootsect.lis third.lis mbr.lis bitmap.lis pseudo.lis mbr2.lis \
pseudo1.lis loader.lis pseudo3.lis
BFILES=first.b second.b third.b bitmap.b chain.b mbr.b mbr2.b \
floppy2: disk.b
@echo
@echo Creating Diagnostic Floppy 2.4
- @make -C ../diagnose check
- @make -C ../diagnose floppy
+ @$(MAKE) -C ../diagnose check
+ @$(MAKE) -C ../diagnose floppy
diagnostic: ../test.img diag1.img diag2.img diag3.img
dd if=$*.img of=$*.b bs=32 skip=1
edit: $(EDIT)
- $(CC) -Wall -s -O -DSTANDALONE -o edit $(EDIT) $(LDFLAGS)
+ $(CC) $(CFLAGS) -DSTANDALONE -o edit $(EDIT) $(LDFLAGS)
-loader.i: mkloader first.b second.b third.b bitmap.b mbr.b \
- chain.b os2_d.b mbr2.b
+loader.i: mkloader first.b second.b third.b bitmap.b mbr.b chain.b mbr2.b
./mkloader >loader.i
disk.com: disk.b
rm -f $(TMP).S
pseudo2.s: bootsect.S pseudo.S
- make -C ../diagnose all
+ $(MAKE) -C ../diagnose all
cat bootsect.S pseudo.S >$(TMP).S
$(CPP) -traditional $(PCONFIG) \
-DSIZEKRNL=`wc -c <../diagnose/test4.com | sed "s/ //g"` \
rm -f $(TMP).S
pseudo3.s: bootsect.S pseudo.S
- make -C ../diagnose all
+ $(MAKE) -C ../diagnose all
cat bootsect.S pseudo.S >$(TMP).S
$(CPP) -traditional $(PCONFIG) \
-DSIZEKRNL=`wc -c <../diagnose/test5.com | sed "s/ //g"` \
cat pseudo1.b disk.com >diag1.img
diag2.img: pseudo2.b
- make -C ../diagnose all
+ $(MAKE) -C ../diagnose all
cat pseudo2.b ../diagnose/test4.com >diag2.img
diag3.img: pseudo3.b
- make -C ../diagnose all
+ $(MAKE) -C ../diagnose all
cat pseudo3.b ../diagnose/test5.com >diag3.img
flags.i: ../test.img Makefile version $(CFILES) $(HFILES)
chain.s: chain.S lilo.h version.h first.b Makefile
$(CPP) $(PCONFIG) -DCHAIN=0x536a7646 chain.S -o chain.s
-os2_d.s: chain.S lilo.h version.h first.b Makefile
- $(CPP) $(PCONFIG) chain.S -DDOS_D -o os2_d.s
-
xxx.s: chain.S lilo.h Makefile
$(CPP) chain.S -DXXX -o xxx.s
rm -f $$DESTDIR$(BOOT_DIR)/boot-text.b; rm -f $$DESTDIR$(BOOT_DIR)/boot-text.old; fi
@if [ -f $$DESTDIR$(BOOT_DIR)/chain.b ]; then \
mv $$DESTDIR$(BOOT_DIR)/chain.b $$DESTDIR$(BOOT_DIR)/chain.old; fi
- @if [ -f $$DESTDIR$(BOOT_DIR)/os2_d.b ]; then \
- mv $$DESTDIR$(BOOT_DIR)/os2_d.b $$DESTDIR$(BOOT_DIR)/os2_d.old; fi
@if [ -f $$DESTDIR$(BOOT_DIR)/mbr.b ]; then \
mv $$DESTDIR$(BOOT_DIR)/mbr.b $$DESTDIR$(BOOT_DIR)/mbr.old; fi
- if [ -f os2_d.b -a $(BUILTIN) -eq 0 ]; then cp os2_d.b $$DESTDIR$(BOOT_DIR); fi
if [ -f chain.b -a $(BUILTIN) -eq 0 ]; then cp chain.b $$DESTDIR$(BOOT_DIR); fi
if [ -f mbr.b -a $(BUILTIN) -eq 0 ]; then cp mbr.b $$DESTDIR$(BOOT_DIR); fi
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
+ [ -x lilo.static ] && strip lilo.static
cp ../mkrescue $$DESTDIR$(USRSBIN_DIR)/mkrescue
cp ../keytab-lilo.pl $$DESTDIR$(USRSBIN_DIR)/keytab-lilo
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
rm -f $$DESTDIR$(BOOT_DIR)/diag1.img
rm -f $$DESTDIR$(BOOT_DIR)/diag2.img
- if [ -f $$DESTDIR$(BOOT_DIR)/os2_d.b ]; then \
- rm -f $$DESTDIR$(BOOT_DIR)/os2_d.b; fi
if [ -f $$DESTDIR$(BOOT_DIR)/chain.b ]; then \
rm -f $$DESTDIR$(BOOT_DIR)/chain.b; fi
if [ -f $$DESTDIR$(BOOT_DIR)/mbr.b ]; then \