Makefile 584 B

1234567891011121314151617181920212223242526272829
  1. CFLAGS:= -fopenmp
  2. LDFLAGS:= -fopenmp
  3. CXX:= gcc
  4. PROG:= openmp-hello-world
  5. DESTDIR:=
  6. PREFIX:=
  7. OBJS:= main.o
  8. all: $(PROG)
  9. %.o: src/%.c src/%.h
  10. $(CXX) $(CFLAGS) -c $<
  11. $(PROG): $(OBJS)
  12. $(CXX) -Wall -Wextra -pedantic -g $(OBJS) -o $(PROG) $(LDFLAGS)
  13. install: all
  14. @echo installing executable file to ${DESTDIR}${PREFIX}/bin
  15. @mkdir -p ${DESTDIR}${PREFIX}/bin
  16. @cp -f ${PROG} ${DESTDIR}${PREFIX}/bin
  17. @chmod 755 ${DESTDIR}${PREFIX}/bin/${PROG}
  18. uninstall:
  19. @echo removing executable file from ${DESTDIR}${PREFIX}/bin
  20. @rm -f ${DESTDIR}${PREFIX}/bin/${PROG}
  21. clean:
  22. rm -f $(PROG) *.o