Ethereal-dev: Re: [Ethereal-dev] Bug in Makefile.nmake

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: aferen@xxxxxxxxxxxx (Andrew C. Feren)
Date: 28 Feb 2002 22:20:16 -0500
Guy Harris <guy@xxxxxxxxxx> writes:

> On Thu, Feb 28, 2002 at 09:42:55PM -0500, Andrew C. Feren wrote:
> > This should build from either the tarball or cvs.
> > 
> > 1) PYTHON is defined
> >         register.c and packet-ncp2222.c will be built as needed
> 
> I assume it'll rebuild "packet-ncp2222.c" if "ncp2222.py" is more
> recent, even if "packet-ncp2222.c" exists.

Should be a safe assumption.  I didn't do any thing to prevent that.

> > That seems reasonable.  This updated patch should allow this.
> 
> The attached patch file appears to be zero-length.

So it is.  Weird.  This one looks like it has some content.

Index: Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/Makefile.nmake,v
retrieving revision 1.172
diff -u -r1.172 Makefile.nmake
--- Makefile.nmake	2002/02/27 09:42:38	1.172
+++ Makefile.nmake	2002/03/01 03:16:43
@@ -404,15 +404,25 @@
 	$(PERL) process-x11-fields.pl <x11-fields
 
 packet-ncp2222.c : ncp2222.py
+!IFDEF PYTHON
 	@echo Making packet-ncp2222.c
 	$(PYTHON) ncp2222.py > packet-ncp2222.c
+!ELSE
+	@echo Faking packet-ncp2222.c...
+	@echo Either python or $@ is required to build the ncp disector
+	@echo Hiding packet-ncp.c...
+	mv packet-ncp.c packet-ncp.c.save
+	touch packet-ncp.c $@
+!ENDIF
 
 register.c: $(DISSECTOR_SRC)
-	@echo Making register.c
-	@$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
-#	How are ifdef's done in NMAKE? It would be nice
-#	to use python if PYTHON is defined, otherwise try to use shell.
-#	@sh make-reg-dotc . $(DISSECTOR_SRC)
+!IFDEF PYTHON
+	@echo Making register.c (using python)
+        @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
+!ELSE
+	@echo Making register.c (using sh)
+        @sh make-reg-dotc register.c $(DISSECTOR_SRC)
+!ENDIF
 
 text2pcap-scanner.c : text2pcap-scanner.l
 	$(LEX) -otext2pcap-scanner.c text2pcap-scanner.l

[...]


-- 
-Andrew Feren
 Cetacean Networks, Inc.
 Portsmouth, NH