Avoid rebuilding nmap every time "make" is run. The target "all" takes

care of building all prerequisites. One downside is that you can't do
"make nmap" in an clean tree any more, if anyone ever did that. You have
to do "make" once to build the prerequisites. This is how Automake does
it. I'll keep thinking about this.
This commit is contained in:
david 2007-10-14 04:24:42 +00:00
parent b41c987471
commit 8725d37b47

View file

@ -76,8 +76,10 @@ OBJS = main.o nmap.o targets.o tcpip.o nmap_error.o utils.o idle_scan.o osscan.o
.cc.o:
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
all: $(TARGET) $(TARGETNMAPFE) $(BUILDUMIT)
$(TARGET): @LUA_DEPENDS@ @PCAP_DEPENDS@ @PCRE_DEPENDS@ @DNET_DEPENDS@ $(NBASEDIR)/libnbase.a $(NSOCKDIR)/src/libnsock.a $(NSESTDLIB) $(OBJS)
all: @LUA_DEPENDS@ @PCAP_DEPENDS@ @PCRE_DEPENDS@ @DNET_DEPENDS@ $(NBASEDIR)/libnbase.a $(NSOCKDIR)/src/libnsock.a $(NSESTDLIB)
$(MAKE) $(TARGET) $(TARGETNMAPFE) $(BUILDUMIT)
$(TARGET): $(OBJS)
echo Compiling nmap
rm -f $@
$(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)