0

(Similar question here). For every .x file in the directory I want to run a command to generate an HTML file. The command already works fine, it's the Makefile that I'm having trouble with. Here's what I came up with:

all: $(OBJECTS)
OBJECTS := $(patsubst %.x,%.html,$(wildcard *.x)) 
%.html: %.x
    generate $< > $@

The OBJECTS variable is meant to contain all html files I need to generate. Invoking make states nothing to be done for 'all', and there are no HTML files already in the directory.

Community
  • 1
  • 1
Charles
  • 67
  • 7

1 Answers1

0

Turns out make is sensitive to the order of your variable definitions. The Makefile works when the first two lines are switched!

Charles
  • 67
  • 7