From b34e817e2fbf4aea12a36bb94cb6a85ba6ec747c Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Fri, 21 Dec 2007 09:30:15 +0000 Subject: [PATCH] remove lib folder creation from top level make. fix generation of TOPDIR in subdirectories. --- Makefile | 7 ++----- gba/Makefile | 7 ++++--- nds/Makefile | 11 +++++------ 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 5732a26..b9f50d3 100644 --- a/Makefile +++ b/Makefile @@ -10,14 +10,11 @@ default: release all: release dist -lib: - @[ -d $@ ] || mkdir -p $@ - -release: lib +release: make -C nds BUILD=release make -C gba BUILD=release -debug: lib +debug: make -C nds BUILD=debug make -C gba BUILD=debug diff --git a/gba/Makefile b/gba/Makefile index 4467aac..f288a93 100644 --- a/gba/Makefile +++ b/gba/Makefile @@ -7,7 +7,6 @@ endif include $(DEVKITARM)/gba_rules -TOPDIR ?= $(CURDIR)/.. #--------------------------------------------------------------------------------- # BUILD is the directory where object files & intermediate files will be placed @@ -67,6 +66,7 @@ LIBDIRS := $(LIBGBA) ifneq ($(BUILD),$(notdir $(CURDIR))) #--------------------------------------------------------------------------------- +export TOPDIR ?= $(CURDIR)/.. export DEPSDIR := $(CURDIR)/$(BUILD) @@ -140,6 +140,9 @@ $(GBABIN) : $(OFILES) $(LIB) @$(AR) rcs "$(GBABIN)" $(OFILES) @echo built ... $(notdir $@) +$(LIB): + mkdir $(LIB) + #--------------------------------------------------------------------------------- # you need a rule like this for each extension you use as binary data #--------------------------------------------------------------------------------- @@ -155,5 +158,3 @@ $(GBABIN) : $(OFILES) $(LIB) endif #--------------------------------------------------------------------------------------- -$(LIB): - mkdir $(LIB) diff --git a/nds/Makefile b/nds/Makefile index 867ab8e..e199a8a 100644 --- a/nds/Makefile +++ b/nds/Makefile @@ -7,8 +7,6 @@ endif include $(DEVKITARM)/ds_rules -TOPDIR ?= $(CURDIR)/.. - #--------------------------------------------------------------------------------- # BUILD is the directory where object files & intermediate files will be placed # SOURCES is a list of directories containing source code @@ -28,8 +26,6 @@ LIB := $(TOPDIR)/nds/lib #--------------------------------------------------------------------------------- ARCH := -mthumb -mthumb-interwork -# note: arm9tdmi isn't the correct CPU arch, but anything newer and LD -# *insists* it has a FPU or VFP, and it won't take no for an answer! CFLAGS := -g -Wall -O2\ -march=armv5te -mtune=arm946e-s -fomit-frame-pointer\ -ffast-math \ @@ -65,6 +61,8 @@ LIBDIRS := $(LIBNDS) ifneq ($(BUILD),$(notdir $(CURDIR))) #--------------------------------------------------------------------------------- +export TOPDIR ?= $(CURDIR)/.. + export DEPSDIR := $(CURDIR)/$(BUILD) @@ -120,6 +118,9 @@ $(ARM9BIN) : $(OFILES) $(LIB) @$(AR) rcs "$(ARM9BIN)" $(OFILES) @echo built ... $(notdir $@) +$(LIB): + mkdir $(LIB) + -include $(DEPENDS) @@ -127,5 +128,3 @@ $(ARM9BIN) : $(OFILES) $(LIB) endif #--------------------------------------------------------------------------------------- -$(LIB): - mkdir $(LIB)