Makefile fixes

svn path=/trunk/; revision=3018
This commit is contained in:
Brian Palmer 2002-06-06 21:33:13 +00:00
parent aa8aca9ec4
commit 0bb513eddf
5 changed files with 62 additions and 53 deletions

View file

@ -17,33 +17,34 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
export CC = gcc
export LD = ld
export AR = ar
export RM = cmd /C del
export CP = cmd /C copy
export NASM_CMD = nasm
RM = cmd /C del
NASM_CMD = nasm
BIN2C = ../tools/bin2c
TOOLSDIR = ../tools
.PHONY : clean
all: fat.bin fat32.bin isoboot.bin bin2c.exe
all: $(BIN2C) fat.bin fat32.bin isoboot.bin
fat.bin: fat.asm bin2c.exe
$(NASM_CMD) -o fat.bin -f bin fat.asm
bin2c fat.bin fat.h fat_data
$(BIN2C) :
@$(MAKE) --no-print-directory -C $(TOOLSDIR)
fat.bin : fat.asm $(BIN2C)
@echo ===================================================== Assembling fat
@$(NASM_CMD) -o fat.bin -f bin fat.asm
@$(BIN2C) fat.bin fat.h fat_data
fat32.bin: fat32.asm bin2c.exe
$(NASM_CMD) -o fat32.bin -f bin fat32.asm
bin2c fat32.bin fat32.h fat32_data
fat32.bin : fat32.asm $(BIN2C)
@echo ===================================================== Assembling fat32
@$(NASM_CMD) -o fat32.bin -f bin fat32.asm
@$(BIN2C) fat32.bin fat32.h fat32_data
isoboot.bin: isoboot.asm
$(NASM_CMD) -o isoboot.bin -f bin isoboot.asm
bin2c.exe: bin2c.c
$(CC) -o bin2c.exe bin2c.c
isoboot.bin : isoboot.asm
@echo ===================================================== Assembling isoboot
@$(NASM_CMD) -o isoboot.bin -f bin isoboot.asm
clean:
- $(RM) *.bin
- $(RM) *.exe
- $(RM) *.h
@-$(RM) *.bin
@-$(RM) *.h
@echo Clean ALL done.

View file

@ -41,10 +41,10 @@ RM = cmd /C del
CP = cmd /C copy
MKDIR = cmd /C md
RMDIR = cmd /C rd
MAKE = make
NASM_CMD = nasm
OBJCOPY = objcopy
DEPTOOL = $(SRCDIR)/../tools/deptool
TOOLSDIR = $(SRCDIR)/../tools
#-----------------------------------------------------------------------------------------------------
# TEST IF WE ARE IN THE TARGET DIRECTORY
@ -240,9 +240,8 @@ all : $(DEPTOOL) freeldr.sys
#############################################
$(DEPTOOL): $(DEPTOOL).c
@echo ===================================================== Compiling deptool
@$(CC) -Wall -O3 -o $@ $<
$(DEPTOOL) :
@$(MAKE) --no-print-directory -C $(TOOLSDIR)
#############################################

View file

@ -18,13 +18,9 @@
#
export CC = gcc
export LD = ld
export AR = ar
export RM = cmd /C del
export CP = cmd /C copy
export NASM = nasm
export MAKE = make
CC = gcc
LD = ld
RM = cmd /C del
FLAGS = -Wall
@ -34,16 +30,24 @@ LIBS = -lkernel32
.PHONY : clean
all: install.exe
all: ../bootsect/fat.h ../bootsect/fat32.h install.exe
../bootsect/fat.h ../bootsect/fat32.h :
@$(MAKE) --no-print-directory -C ../bootsect
install.exe: $(OBJS)
@echo ===================================================== LINKING install
$(CC) $(FLAGS) -o install.exe $(OBJS)
install.o: install.c install.h volume.h
@echo ===================================================== Compiling $*
$(CC) $(FLAGS) -o install.o -c install.c
volume.o: volume.c volume.h install.h
@echo ===================================================== Compiling $*
$(CC) $(FLAGS) -o volume.o -c volume.c
clean:
@-$(RM) *.o
@-$(RM) *.exe
@echo Clean ALL done.

View file

@ -1,6 +1,6 @@
#
# FreeLoader
# Copyright (C) 1999, 2000, 2001 Brian Palmer <brianp@sginet.com>
# Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
#
# 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
@ -16,29 +16,34 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
export CC = gcc
export LD = ld
export AR = ar
export RM = cmd /C del
export CP = cmd /C copy
export NASM_CMD = nasm
export MAKE = make
.PHONY : bootsect freeldr install clean
#############################################
# PROGRAMS
#
CC = gcc
RM = cmd /C del
all: bootsect freeldr install
#############################################
bootsect:
$(MAKE) -C bootsect
TOOLS = deptool \
bin2c
freeldr: bootsect
$(MAKE) -C freeldr
#############################################
install:
$(MAKE) -C install
all : $(TOOLS)
#############################################
%: %.c
@echo ===================================================== Compiling $*
@$(CC) -Wall -O3 -o $@ $<
#############################################
.PHONY : clean
clean:
$(RM) *.bin
$(MAKE) -C freeldr clean
@-$(RM) $(TOOLS)
@-$(RM) *.exe
@echo Clean ALL done.