makefile 431B

1234567891011121314151617181920212223
  1. CXX ?= g++
  2. CXXFLAGS ?= -O2 -g
  3. LDFLAGS += -lX11 -lXext -lrt
  4. SOURCES = main.cpp x.cpp cmdline.c rectangle.cpp
  5. OBJECTS = main.o x.o cmdline.o rectangle.o
  6. EXECUTABLE = slop
  7. BINDIR = "/usr/bin"
  8. all: $(EXECUTABLE)
  9. $(EXECUTABLE): $(OBJECTS)
  10. $(CXX) $(OBJECTS) -o $@ $(LDFLAGS)
  11. clean:
  12. $(RM) $(OBJECTS)
  13. dist-clean: clean
  14. $(RM) $(EXECUTABLE)
  15. install: all
  16. mkdir -p $(DESTDIR)$(BINDIR)
  17. cp $(CURDIR)/$(EXECUTABLE) $(DESTDIR)$(BINDIR)