From: <cho...@us...> - 2003-01-02 02:35:24
|
Update of /cvsroot/pyaros/PyAROS In directory sc8-pr-cvs1:/tmp/cvs-serv314 Modified Files: Makefile Log Message: Implemented separate build directories for intermedietary files, which means that you can have several version built (tiny, regular, tiny+debug, regular+debug) without them interfering with each other [no more "make clean"]. Index: Makefile =================================================================== RCS file: /cvsroot/pyaros/PyAROS/Makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile 30 Dec 2002 13:16:47 -0000 1.9 --- Makefile 2 Jan 2003 02:35:19 -0000 1.10 *************** *** 1,49 **** ! # Configuration section ! EXEDIR ?= ../Build ! EXE ?= $(EXEDIR)/Python ! TINY ?= no ! DEBUG ?= yes ! ifeq ($(DEBUG),yes) ! CC := i386-linux-aros-gcc ! EXEDIR := $(EXEDIR)-Debug else ! CC := i386-pc-aros-gcc endif ! ifeq ($(TINY),yes) ! EXEDIR := $(EXEDIR)-Tiny endif ! SUBDIRS := Python Parser Objects Modules Lib ! # Every component makefile will add to the variables below, if needed. ! FILES := # Source files to be compiled. ! MODULE_FILES := # Module files to be copied to $(PYTHONDIR). ! MODULE_DIRS := # Module directories to be created in $(PYTHONDIR). ! CFLAGS := -I. -IInclude -DAROS -D'PLATFORM="AROS"' ! LIBS := -larossupport -lamiga ! ifeq ($(TINY),no) ! LIBS := $(LIBS) -larosz -lexpat endif - # Setup additional options ifeq ($(TINY),yes) ! CFLAGS += -DPYTHON_TINY ! endif ! ! ifeq ($(DEBUG),yes) ! CFLAGS += -g3 else ! CFLAGS += -O3 -fomit-frame-pointer endif include $(patsubst %, %/module.make, $(SUBDIRS)) SRCS := $(patsubst %, %.c, $(FILES)) ! OBJS := $(patsubst %, %.o, $(FILES)) ! DEPS := $(patsubst %, %.d, $(FILES)) ! DIRS := $(EXEDIR) $(EXEDIR)/Libs $(EXEDIR)/Libs/Python \ $(patsubst %, $(EXEDIR)/Libs/Python/%, $(MODULE_DIRS)) MODS := $(patsubst %, $(EXEDIR)/Libs/Python/%, $(MODULE_FILES)) --- 1,65 ---- ! ### Configuration ############################################################## ! #%% Options %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! # Build tiny version? ! TINY ?= no ! # Build debug version? ! DEBUG ?= yes ! #%% Paths %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! # Base directory for intermediate build files. ! OBJDIR_BASE ?= ../Build ! # Base directory for final build files. ! EXEDIR_BASE ?= ../Final ! ! ### Initial setup ############################################################## ! #%% Components %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! SUBDIRS := Python Parser Objects Modules Lib ! ! # Every component makefile will add to the variables below, if needed. ! FILES := # Source files to be compiled. ! MODULE_FILES := # Module files to be copied to $(PYTHONDIR). ! MODULE_DIRS := # Module directories to be created in $(PYTHONDIR). ! ! ### Processing of options ###################################################### ! #%% Paths %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! ifeq ($(TINY),yes) ! SUFFIX := Tiny else ! SUFFIX := Regular endif ! ifeq ($(DEBUG),yes) ! SUFFIX := $(SUFFIX)DEBUG endif ! OBJDIR := $(OBJDIR_BASE)/$(SUFFIX) ! EXEDIR := $(EXEDIR_BASE)/$(SUFFIX) ! EXE := $(EXEDIR)/Python ! #%% Compiler and libraries %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! CFLAGS := -I. -IInclude -DAROS -D'PLATFORM="AROS"' ! LIBS := -larossupport -lamiga ! ifeq ($(DEBUG),yes) ! CC := i386-linux-aros-gcc ! CFLAGS := $(CFLAGS) -g3 ! else ! CC := i386-pc-aros-gcc ! CFLAGS := $(CFLAGS) -O3 -fomit-frame-pointer endif ifeq ($(TINY),yes) ! CFLAGS := $(CFLAGS) -DPYTHON_TINY else ! LIBS := $(LIBS) -larosz -lexpat endif + ### Build rules ################################################################ include $(patsubst %, %/module.make, $(SUBDIRS)) SRCS := $(patsubst %, %.c, $(FILES)) ! OBJS := $(patsubst %, $(OBJDIR)/%.o, $(FILES)) ! DEPS := $(patsubst %, $(OBJDIR)/%.d, $(FILES)) ! DIRS := $(EXEDIR) $(EXEDIR)/Libs $(EXEDIR)/Libs/Python $(OBJDIR) \ $(patsubst %, $(EXEDIR)/Libs/Python/%, $(MODULE_DIRS)) MODS := $(patsubst %, $(EXEDIR)/Libs/Python/%, $(MODULE_FILES)) *************** *** 51,72 **** all : setup depend $(EXE) - $(EXE) : $(OBJS) - @echo Linking $(basename $@) ... - @$(CC) $(CFLAGS) $^ $(LIBS) -o $@ - ifeq ($(DEBUG),no) - @echo Stripping $(basename $@) ... - @strip --strip-unneeded $@ - endif - - %.o : %.c - @echo Compiling $@ ... - @$(CC) $(CFLAGS) $< -c -o $@ - - depend : $(DEPS) - - %.d : %.c - @echo Finding dependencies for $< ... - @$(CC) $(CFLAGS) -M $< > $@ - setup : @mkdir -p $(DIRS) --- 67,70 ---- *************** *** 79,82 **** --- 77,100 ---- fi; \ done + + depend : $(DEPS) + + $(EXE) : $(OBJS) + @echo Linking $(notdir $@)... + @$(CC) $(CFLAGS) $^ $(LIBS) -o $@ + ifeq ($(DEBUG),no) + @echo Stripping $(notdir $@)... + @strip --strip-unneeded $@ + endif + + $(OBJDIR)/%.d : %.c + @echo Finding dependencies for $<... + @mkdir -p $(dir $@) + @$(CC) $(CFLAGS) -M $< > $@ + + $(OBJDIR)/%.o : %.c + @echo Compiling $<... + @mkdir -p $(dir $@) + @$(CC) $(CFLAGS) $< -c -o $@ clean : |