[comp.unix.questions] Make and making subdirectories

murphys@cod.NOSC.MIL (Steven P. Murphy) (01/23/88)

TO ALL THE MAKE EXPERTS:

        below is a piece of the makefile from PC curses it works fine.
and below that is where I tried to use something similar but it doesn't
work.  can anyone point out to me why?

        the problem with mine is it goes to all: then to build: and then
to setup: does the %mkdir apcc  and no matter weither it created apcc
or apcc was all ready there make stops.  now if I use the -i option
everything goes fine or the -n option show every thing to be happening
right.

        what really gets me is why the PC curses makefile works fine.

        ANY HELP would be GREATLY appreciated

        send replies to me at the below address and if I get the correct
information I'll post it to the net.


------------------------------------------- 
 _ _ _				Clarke's law, 2nd varation:
' ) ) )             /
 / / / . . __  _   /_		    "Any sufficiently advanced technology
/ ' (_(_/_/ (_/_)_/ /_		    is indistinguishable from a rigged demo"
             /			
            '
------------------------

S. P. Murphy
Internet: murphys@cod.nosc.mil      UUCP: {ucbvax,hplabs}!sdcsvax!nosc!murphys


***************************************************************************
                        does  work    - from PC curses posted awhile back
***************************************************************************


LIBDIR= \lib
INCDIR= \include

# General definitions:

COBJS=          attrib.obj   beep.obj     boxes.obj    charadd.obj   \
                chardel.obj  charget.obj  charins.obj  charpick.obj  \
                clrtobot.obj clrtoeol.obj endwin.obj   initscr.obj   \
                linedel.obj  lineins.obj  longname.obj move.obj      \
                mvcursor.obj newwin.obj   options.obj  overlay.obj   \
                prntscan.obj refresh.obj  scrreg.obj   setterm.obj   \
                stradd.obj   strget.obj   termmisc.obj tabsize.obj   \
                unctrl.obj   update.obj   winclear.obj windel.obj    \
                winerase.obj winmove.obj  winscrol.obj wintouch.obj

ASMOBJS=        cursesio.obj

OBJS=           $(COBJS) $(ASMOBJS)

#################################################################
# 'all' is all that can (and usually is) done                   #
#################################################################

all:            small compact medium large

#################################################################
# The following copies the header files to their proper place   #
#################################################################

headers:        $(INCDIR)\curses.h $(INCDIR)\curspriv.h

$(INCDIR)\curses.h:     curses.h
        %copy curses.h $(INCDIR)\curses.h

$(INCDIR)\curspriv.h:   curspriv.h
        %copy curspriv.h $(INCDIR)\curspriv.h

#################################################################
# The following will create a subdirectory for each memory      #
# model, and initiate the make:ing in each one.                 #
#################################################################

#################################################################
# create work directory if non-existent, go to it, and          #
# perform the job - small model                                 #
#################################################################

small:          headers                 \
                smodel                  \
                smodel\farnear.inc      \
                smodel\smalhuge.inc
        %cd     smodel
        -make   -f ..\makefile.qcl $(MAKEFLAGS) "MODEL=S" $(LIBDIR)\Scurses.lib
        %cd     ..

smodel:
        %mkdir  smodel

smodel\farnear.inc:     nearcall.inc
        %copy   nearcall.inc    smodel\farnear.inc

smodel\smalhuge.inc:    smaldata.inc
        %copy   smaldata.inc    smodel\smalhuge.inc


***************************************************************************
                        doesn't  work    -   but would like it to
***************************************************************************

# General definitions:


FOROBJS=          apal.obj     errmes.obj   apali.obj    exflds.obj    \
                  float2.obj   fpget.obj    fsym.obj     fusym.obj     \
                  garg.obj     gbrk.obj     gfield.obj   gline.obj     \
                  gnum.obj     gsym.obj     gval.obj     header.obj    \
                  iaddc.obj    icmp32.obj   ineg32.obj   ipfix.obj     \
                  isub32.obj   length.obj   nand32.obj   negchk.obj    \
                  optab.obj    packs.obj    pass1.obj    pfloat.obj    \
                  readln.obj   rtoe.obj     sndmes.obj   tables.obj    \
                  typchr.obj   wlin.obj     itas.obj     sgnext.obj    \
                  pnum.obj     pass2.obj


COBJS=            gbits.obj   pbits.obj

ASMOBJS=

OBJS=           $(FOROBJS) $(COBJS) $(ASMOBJS)



#################################################################
# 'all' is all that can (and usually is) done                   #
#################################################################

all:            build

#################################################################
# The following copies the header files to their proper place   #
#################################################################

headers:        dosstuff

dosstuff:     ap-msdos.h
        %copy ..\ap-msdos.h ap-msdos.h

#################################################################
# The following will create a subdirectory to work in           #
# so that the files don't get mixed up.                         #
#################################################################

#################################################################
# create work directory if non-existent, go to it, and          #
# perform the job - build the AP cross-compiler                 #
#################################################################

build:          setup                   \
                change                  \
                headers
        -make   -f ..\makefile apal.exe
        %cd     ..

setup:
        %mkdir  apcc

change:
        %cd     apcc