# Copyright (c) 1993 Xerox Corporation. All rights reserved. # #-$Id$ # #-$Date$ # # # VERY IMPORTANT: # NO target-config-dependent things go in in Makefile directly. # ALL target-config-dependent things go in config.mk, below. # # # # include config.mk here to define: # # CC - C compiler # CONFIG_CPPFLAGS # CONFIG_CFLAGS # # ASPP - assembler preprocessor (CPP) # CONFIG_ASPPFLAGS # # AS - assembler # CONFIG_ASFLAGS # # LD - loader # CONFIG_LDFLAGS # include ../config/config.mk # # location of shared sources # INCLUDE = -I../posix -I../.. # # locations of object files # INSTALL_LIB = ../lib INSTALL_BIN = ../bin # # compilation flags, etc. # CPPFLAGS = $(INCLUDE) $(CONFIG_CPPFLAGS) -DPCR_NO_RENAME CFLAGS =-c -O $(CONFIG_CFLAGS) ASPPFLAGS = $(INCLUDE) $(CONFIG_ASPPFLAGS) -DPCR_NO_RENAME -DASM ASFLAGS = $(CONFIG_ASFLAGS) LDFLAGS = $(CONFIG_LDFLAGS) # # standard commands and default rules # INSTALL = cp -p .s.o: $(ASPP) $(ASPPFLAGS) $< | $(AS) $(ASFLAGS) -o $@ .c.o: $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ # # # # # BEGIN PACKAGE-SPECIFIC PART # # # # # # Default target # default: ???? # # SOURCE FILE DEFINITION # # define CSRC SSRC MISCSRC HDEFS MISCDEFS. # # define MAKEDEP_MISCSRC = commands to make MISCSRC dependencies # (dependencies for .c and .s files are done automatically). # CSRC = ???.c SSRC = MISCSRC = SRC = $(CSRC) $(SSRC) $(MISCSRC) MAKEDEP_MISCSRC = HDEFS = ???.h MISCDEFS = DEFS = $(HDEFS) $(MISCDEFS) # # # INSTALL DEFINITION # # define INSTALL_LIBFILES = targets to be copied into INSTALL_LIB # define INSTALL_BINFILES = targets to be copied into INSTALL_BIN # INSTALL_LIBFILES = base.o INSTALL_BINFILES = # # package-specific definitions and rules # COBJ = mypkg.o SOBJ = mypkg_support.o MISCOBJ = mypkg: $(COBJ) $(SOBJ) $(MISCOBJ) $(LD) -o mypkg $(COBJ) $(SOBJ) $(MISCOBJ) \ $(CONFIG_OBJ_TREE)/other/libother.a # # # # # END PACKAGE-SPECIFIC PART # # # # # # # STANDARD TARGETS # # # # make install # install: $(INSTALL_LIBFILES) $(INSTALL_BINFILES) if [ -n "$(INSTALL_LIBFILES)" ] ; then \ ( cd $(INSTALL_LIB) ; rm -f $(INSTALL_LIBFILES) ) ; \ $(INSTALL) $(INSTALL_LIBFILES) $(INSTALL_LIB) ; \ fi if [ -n "$(INSTALL_BINFILES)" ] ; then \ ( cd $(INSTALL_BIN) ; rm -f $(INSTALL_BINFILES) ) ; \ $(INSTALL) $(INSTALL_BINFILES) $(INSTALL_BIN) ; \ fi $(CHECKIN) -l # # make clean # clean: rm -f *.o *~ core a.out *.a *.BAK *.bak *.CKP logmsg.txt # # make depend # # NOTE: the makefile must include "# DO NOT DELETE THIS LINE" # and at least one additional line of text after the last target. # "make depend" will replace everything following that line # by a newly-constructed list of dependencies. # # You can modify the behavior of this target by defining $(MAKEDEP_MISCSRC). # makedep: $(CSRC) $(SSRC) $(MISCSRC) echo -n > makedep $(MAKEDEP_MISCSRC) for x in $(CSRC) END ; \ do if [ $$x != END ]; then \ $(CPP) -M $(CPPFLAGS) $$x \ | sed -e '/:$$/d' >> makedep ; \ fi ; \ done for x in $(SSRC) END ; \ do if [ $$x != END ]; then \ $(ASPP) -M $(ASPPFLAGS) $$x \ | sed -e '/:$$/d' \ | sed -e 's/[.]s[.]o :/.o :/g' >> makedep ; \ fi ; \ done depend: makedep echo '/^# DO NOT DELETE THIS LINE/+1,$$d' > eddep echo '$$r makedep' >> eddep echo 'w' >> eddep rm -f Makefile.bak mv Makefile Makefile.bak cp Makefile.bak Makefile chmod u+w Makefile ex - Makefile < eddep if [ ! -w Makefile.bak ] ; then chmod u-w Makefile ; fi rm -f eddep makedep # # # END OF HUMAN-EDITABLE PART # # # #-$Log$ # # # DO NOT DELETE THIS LINE -- make depend depends on it # and there had better be at least one additional line