From ce8d7ff0ad7073190020493fe76369500a560612 Mon Sep 17 00:00:00 2001 From: Charlie Gordon Date: Wed, 4 Jun 2008 08:49:24 +0000 Subject: [PATCH] moved object files to .objs subtree --- .cvsignore | 2 +- Makefile | 39 ++++++++++++++++++------------ libqhtml/Makefile | 60 +++++++++++++++++++++++++++++++++-------------- 3 files changed, 68 insertions(+), 33 deletions(-) diff --git a/.cvsignore b/.cvsignore index d6cb322..8e029ad 100755 --- a/.cvsignore +++ b/.cvsignore @@ -1,6 +1,6 @@ config.mak config.h -*.o +.objs *.exe qe qe_g diff --git a/Makefile b/Makefile index e4c54ff..b367f31 100644 --- a/Makefile +++ b/Makefile @@ -153,6 +153,16 @@ ifdef CONFIG_INIT_CALLS TOBJS+= qeend.o endif +SRCS:= $(OBJS:.o=.c) +TSRCS:= $(TOBJS:.o=.c) +TSRCS:= $(TSRCS:tqe.c=qe.c) + +OBJS_DIR:=.objs +OBJS:=$(addprefix $(OBJS_DIR)/, $(OBJS)) +TOBJS:=$(addprefix $(OBJS_DIR)/, $(TOBJS)) + +$(shell mkdir -p $(OBJS_DIR)) + # # Dependencies # @@ -186,21 +196,17 @@ tqe$(EXE): tqe_g$(EXE) Makefile echo `size $@` `wc -c $@` tqe $(OPTIONS) \ | cut -d ' ' -f 7-10,13,15-40 >> STATS -tqe.o: qe.c qe.h qestyles.h qeconfig.h config.h config.mak Makefile +$(OBJS_DIR)/tqe.o: qe.c qe.h qestyles.h qeconfig.h config.h config.mak Makefile $(CC) $(DEFINES) -DCONFIG_TINY $(CFLAGS) -o $@ -c $< ffplay$(EXE): qe$(EXE) Makefile ln -sf $< $@ ifndef CONFIG_INIT_CALLS -qe.o: allmodules.txt -tqe.o: basemodules.txt +$(OBJS_DIR)/qe.o: allmodules.txt +$(OBJS_DIR)/tqe.o: basemodules.txt endif -SRCS:= $(OBJS:.o=.c) -TSRCS:= $(TOBJS:.o=.c) -TSRCS:= $(TSRCS:tqe.c=qe.c) - allmodules.txt: $(SRCS) Makefile @echo creating $@ @echo '/* This file was generated automatically */' > $@ @@ -211,13 +217,13 @@ basemodules.txt: $(TSRCS) Makefile @echo '/* This file was generated automatically */' > $@ @grep -h ^qe_module_init $(TSRCS) >> $@ -cfb.o: cfb.c cfb.h fbfrender.h -charsetjis.o: charsetjis.c charsetjis.def -fbfrender.o: fbfrender.c fbfrender.h libfbf.h -qe.o: qe.c qe.h qfribidi.h qeconfig.h -qfribidi.o: qfribidi.c qfribidi.h +$(OBJS_DIR)/cfb.o: cfb.c cfb.h fbfrender.h +$(OBJS_DIR)/charsetjis.o: charsetjis.c charsetjis.def +$(OBJS_DIR)/fbfrender.o: fbfrender.c fbfrender.h libfbf.h +$(OBJS_DIR)/qe.o: qe.c qe.h qfribidi.h qeconfig.h +$(OBJS_DIR)/qfribidi.o: qfribidi.c qfribidi.h -%.o: %.c qe.h qestyles.h config.h config.mak Makefile +$(OBJS_DIR)/%.o: %.c qe.h qestyles.h config.h config.mak Makefile $(CC) $(DEFINES) $(CFLAGS) -o $@ -c $< # @@ -318,6 +324,8 @@ OBJS1=html2png.o util.o cutils.o \ charset.o charsetmore.o charsetjis.o \ libfbf.o fbfrender.o cfb.o fbffonts.o +OBJS1:=$(addprefix $(OBJS_DIR)/, $(OBJS1)) + html2png$(EXE): $(OBJS1) libqhtml/libqhtml.a $(CC) $(LDFLAGS) -o $@ $(OBJS1) \ -L./libqhtml -lqhtml $(HTMLTOPPM_LIBS) @@ -337,10 +345,11 @@ clean: $(MAKE) -C libqhtml clean rm -f *~ *.o *.a *.exe *_g TAGS gmon.out core *.exe.stackdump \ qe tqe qfribidi kmaptoqe ligtoqe html2png fbftoqe fbffonts.c \ - cptoqe jistoqe allmodules.txt basemodules.txt '.#'*[0-9] + cptoqe jistoqe allmodules.txt basemodules.txt '.#'*[0-9] \ + $(OBJS_DIR)/*.o distclean: clean - rm -f config.h config.mak + rm -rf config.h config.mak $(OBJS_DIR) install: $(TARGETS) qe.1 $(INSTALL) -m 755 -d $(DESTDIR)$(prefix)/bin diff --git a/libqhtml/Makefile b/libqhtml/Makefile index 9ed914c..3ebfce8 100644 --- a/libqhtml/Makefile +++ b/libqhtml/Makefile @@ -1,27 +1,52 @@ -include ../config.mak +# Libqhtml tiny HTML/CSS rendering library for QEmacs +# +# Copyright (c) 2000-2002 Fabrice Bellard. +# Copyright (c) 2000-2008 Charlie Gordon. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +DEPTH=.. + +include $(DEPTH)/config.mak CFLAGS:= -Wall -g $(CFLAGS) -funsigned-char --include ../cflags.mk +-include $(DEPTH)/cflags.mk ifdef TARGET_GPROF -CFLAGS+= -p -LDFLAGS+= -p + CFLAGS+= -p + LDFLAGS+= -p endif ifdef TARGET_ARCH_X86 -#CFLAGS+=-fomit-frame-pointer -ifeq ($(GCC_MAJOR),2) -CFLAGS+=-m386 -malign-functions=0 -else -CFLAGS+=-march=i386 -falign-functions=0 -endif + #CFLAGS+=-fomit-frame-pointer + ifeq ($(GCC_MAJOR),2) + CFLAGS+=-m386 -malign-functions=0 + else + CFLAGS+=-march=i386 -falign-functions=0 + endif endif -CFLAGS+=-I.. +CFLAGS+=-I$(DEPTH) -OBJS=css.o xmlparse.o cssparse.o html_style.o docbook_style.o LIB=libqhtml.a +OBJS=css.o xmlparse.o cssparse.o html_style.o docbook_style.o + +OBJS_DIR:=$(DEPTH)/.objs/libqhtml +OBJS:=$(addprefix $(OBJS_DIR)/, $(OBJS)) +$(shell mkdir -p $(OBJS_DIR)) all: $(LIB) @@ -29,13 +54,9 @@ $(LIB): $(OBJS) rm -f $@ $(AR) rc $@ $(OBJS) -%.o: %.c Makefile +$(OBJS_DIR)/%.o: %.c Makefile $(CC) $(DEFINES) $(CFLAGS) -o $@ -c $< -clean: - rm -f *~ *.o *.a *.exe *_g TAGS gmon.out core *.exe.stackdump \ - csstoqe html_style.c docbook_style.c - # # build default style sheet file # @@ -47,3 +68,8 @@ html_style.c: html.css csstoqe$(EXE) docbook_style.c: docbook.css csstoqe$(EXE) ./csstoqe docbook_style < $< > $@ + +clean: + rm -f *~ *.o *.a *.exe *_g TAGS gmon.out core *.exe.stackdump \ + csstoqe html_style.c docbook_style.c \ + $(OBJS_DIR)/*.o