code_junkie

g++ include all /usr/include recursively

Nov 14th, 2011
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <gtkmm.h>
  2.  
  3. # Makefile
  4. ifeq ($(shell pkg-config --modversion gtkmm-2.4),)
  5. $(error Package gtkmm-2.4 needed to compile)
  6. endif
  7.  
  8. CXXFLAGS += `pkg-config --cflags gtkmm-2.4`
  9. LDLIBS += `pkg-config --libs gtkmm-2.4`
  10.  
  11. BINS = program
  12. program_OBJS = a.o b.o c.o
  13.  
  14. all: $(BINS)
  15.  
  16. program: $(program_OBJS)
  17. $(CXX) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
  18.  
  19. # this part is actually optional, since it's covered by gmake's implicit rules
  20. %.o: %.cc
  21. $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
  22.  
  23. pkg-config --cflags --libs gtkmm-2.4
  24.  
  25. #include <gtkmm-2.4/gtkmm.h>
  26.  
  27. INC=-I/usr/include/gtkmm-2.4/
  28.  
  29. helloworld: helloworld.o
  30. g++ -o $@ $<
  31.  
  32. helloworld.o: helloworld.c
  33. g++ $(INC) -c -o $@ $<
  34.  
  35. .PHONY: clean
  36.  
  37. clean:
  38. rm -f helloworld helloworld.o
Add Comment
Please, Sign In to add comment