xparq / NMAKE-Jumpstart

Single-file MSVC/NMAKE "jumpstart" Makefile for building source trees without fuss or extra tooling
0 stars 0 forks source link

Batch mode seems to not be engaged with the inf. rules! :-o #22

Closed xparq closed 1 year ago

xparq commented 1 year ago

It seems pretty robust against \ and / at least:

all: sub\1.obj sub/2.obj

{sub/}.c{sub\}.obj::
    echo do $<

Oh, but the recursion itself kills it! :-(

all: sub\1.obj sub/2.obj
    nmake $**

{sub/}.c{sub\}.obj::
    echo do $<
xparq commented 1 year ago

As a nasty workaround, an option could be added to allow duplicating the actual compilation inf. rule at the compilation wildcard proxy rule... (Just can't be done all at once, as the file list could be of any size.)

UPDATE: No, that's not a viable workaround. Sg. like this

objs: $(src_dir)/$(units_pattern).$(SRC_EXT_)
    $(CXX) $(CFLAGS) $(CXXFLAGS) -Fo$(obj_dir)\ $?

can't work either, because can't set the target(s!) for the sources -- objs is never up-to-date, and what else could there be? The lib? And if there's no lib? The exe? Which one? And then how to build the lib?... Or the obj (sub)dir itself? It would break as soon as a the output tree gets flattened (by some option), but more importantly I just can't see all the possible implications of that.

No. The inf. rules is the only sane option here, and batch mode is broken on recursion. :-/