FLTK logo

Re: [fltk.general] incomplete Circle drawn with classes from PPP

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: incomplete Circle drawn with classes from PPP Ian MacArthur Apr 27, 2021  
 
OK, here's a revised Makefile template that embraces some of the things discussed:

If you fill in the "gaps" (which I hope will be obvious from the comments!) then this pretty much ought to Just Work.
Probably!

################ template makefile ##############
# Set up the paths to the folders we will read files from
PATH_1 := /path/to/some/files
PATH_2 := /path/to/other/files

# Where is the fltk-config we plan to use?
FLTK_CNF := /full/path/to/my/fltk-config

# We don't know what compiler to use to build fltk on this machine - but fltk-config does...
CC  := $(shell $(FLTK_CNF) --cc)
CXX := $(shell $(FLTK_CNF) --cxx)

# Set the flags for compiler: fltk-config knows the basic settings, then we can add our own...
CFLAGS   := $(shell $(FLTK_CNF) --cflags) -Wall -O3 -I$(PATH_1) -I$(PATH_2)
CXXFLAGS := $(shell $(FLTK_CNF) --cxxflags) -Wall -O3 -I$(PATH_1) -I$(PATH_2)

# We don't know what libraries to link with: fltk-config does... Throw in the kitchen sink...
LINKFLTK := $(shell $(FLTK_CNF) --use-gl --use-images --ldstaticflags)

# Possible steps to run after linking...
STRIP      := strip
POSTBUILD  := $(FLTK_CNF) --post # May be required on OSX (does nothing on other platforms, so safe to call)


# Define what your target application is called
TARGET := MyApp
# What objects go into the target application
OBJECTS := file1.o file2.o

all: $(TARGET)

# Define how to build the various object files...

file1.o: $(PATH_1)/file1.c $(PATH_1)/file1.h  # a "plain" C file from PATH_1
$(CC) -c $< -o $@ $(CCFLAGS)

file2.o: $(PATH_2)/file2.cxx $(PATH_2)/file2.h $(PATH_1)/file1.h  # a C++ source file from PATH_2
$(CXX) -c $< -o $@ $(CXXFLAGS)

# Now define how to link the final app
MyApp:  $(OBJECTS)
$(CXX) -o $@ $(OBJECTS) $(LINKFLTK)
$(STRIP) $@
$(POSTBUILD) $@  # only required on OSX, but we call it anyway for portability

clean:
rm -f $(TARGET)
rm -f $(OBJECTS)

############### end #################


 

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/a68dece9-c1b3-4920-94b3-0ef48e703971n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.