diff --git a/freeldr/bootsect/Makefile b/freeldr/bootsect/Makefile index cd5fc2050da..fbccf04b3fe 100644 --- a/freeldr/bootsect/Makefile +++ b/freeldr/bootsect/Makefile @@ -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. diff --git a/freeldr/freeldr/Makefile b/freeldr/freeldr/Makefile index 8a82242fed7..ad6fdc85641 100644 --- a/freeldr/freeldr/Makefile +++ b/freeldr/freeldr/Makefile @@ -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) ############################################# diff --git a/freeldr/install/Makefile b/freeldr/install/Makefile index 9d867c5a250..b0773aa008e 100644 --- a/freeldr/install/Makefile +++ b/freeldr/install/Makefile @@ -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: - \ No newline at end of file + @-$(RM) *.o + @-$(RM) *.exe + @echo Clean ALL done. diff --git a/freeldr/Makefile b/freeldr/tools/Makefile similarity index 56% rename from freeldr/Makefile rename to freeldr/tools/Makefile index aaee5da9580..1f84c6a0837 100644 --- a/freeldr/Makefile +++ b/freeldr/tools/Makefile @@ -1,6 +1,6 @@ # # FreeLoader -# Copyright (C) 1999, 2000, 2001 Brian Palmer +# Copyright (C) 1998-2002 Brian Palmer # # 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. diff --git a/freeldr/bootsect/bin2c.c b/freeldr/tools/bin2c.c similarity index 100% rename from freeldr/bootsect/bin2c.c rename to freeldr/tools/bin2c.c