From 9bac964f85503dfd37cef369f4d664a1aef92094 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Tue, 26 Nov 2024 16:03:07 +0100 Subject: Fix Makefile example in chapter "FLTK Basics" - move linker rule from 'all' to '$(TARGET)' - remove '$(TARGET) $(OBJS)' from rule 'clean' The 'clean' rule required to build everything before it was deleted which was obviously not intended. --- documentation/src/basics.dox | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'documentation/src/basics.dox') diff --git a/documentation/src/basics.dox b/documentation/src/basics.dox index 8e6a350fd..78e7858dd 100644 --- a/documentation/src/basics.dox +++ b/documentation/src/basics.dox @@ -453,24 +453,27 @@ LDSTATIC = $(shell fltk-config --use-gl --use-images --ldstaticflags ) LINK = $(CXX) TARGET = cube -OBJS = CubeMain.o CubeView.o CubeViewUI.o -SRCS = CubeMain.cxx CubeView.cxx CubeViewUI.cxx +OBJS = CubeMain.o CubeView.o CubeViewUI.o +SRCS = CubeMain.cxx CubeView.cxx CubeViewUI.cxx .SUFFIXES: .o .cxx + %.o: %.cxx - $(CXX) $(CXXFLAGS) $(DEBUG) -c $< + $(CXX) $(CXXFLAGS) $(DEBUG) -c $< all: $(TARGET) - $(LINK) -o $(TARGET) $(OBJS) $(LDSTATIC) $(TARGET): $(OBJS) -CubeMain.o: CubeMain.cxx CubeViewUI.h -CubeView.o: CubeView.cxx CubeView.h CubeViewUI.h + $(LINK) -o $(TARGET) $(OBJS) $(LDSTATIC) + +CubeMain.o: CubeMain.cxx CubeViewUI.h +CubeView.o: CubeView.cxx CubeView.h CubeViewUI.h CubeViewUI.o: CubeViewUI.cxx CubeView.h -clean: $(TARGET) $(OBJS) - rm -f *.o 2> /dev/null - rm -f $(TARGET) 2> /dev/null +clean: + rm -f *.o 2> /dev/null + rm -f $(TARGET) 2> /dev/null + \endcode \subsection basics_visual_cpp Compiling Programs with Microsoft Visual C++ -- cgit v1.2.3