X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=Makefile;h=63a1feb9ef37b349e8d951b8c7d65d654894d03f;hb=ecc66f8a935eb4a3188b5336170182e34812fd40;hp=7c0cbe75dbe3127ebef3951decc3c0a1bda419f1;hpb=3da34e1957b3484506b5f0f79f84f64a4cff2f1b;p=smdp.git diff --git a/Makefile b/Makefile index 7c0cbe7..63a1feb 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Makefile # Copyright (C) 2014 Michael Goehler # -# This file is part of mpd. +# This file is part of mdp. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,27 +18,29 @@ # along with this program. If not, see . # -CC = /usr/bin/gcc -CFLAGS = -Wall -g -LDFLAGS = -lncurses +CFLAGS = -O3 -Wall +LDFLAGS = -s +LDLIBS = -lncurses OBJECTS = cstring.o cstack.o markdown.o parser.o viewer.o mdp.o DESTDIR ?= /usr/bin -%.o: %.c - $(CC) $(CFLAGS) -c $< - -mdp: $(OBJECTS) - $(CC) $(CFLAGS) -o mdp $(OBJECTS) $(LDFLAGS) +ifeq ($(DEBUG),1) +CFLAGS := -Wall -g -O0 +LDFLAGS := +endif all: mdp +mdp: $(OBJECTS) + clean: - rm -f $(OBJECTS) mdp + $(RM) $(OBJECTS) mdp install: mdp - if which strip 1>/dev/null 2>&1; then strip mdp; fi - install -d $(PREFIX)$(DESTDIR) - install -m 755 mdp $(PREFIX)$(DESTDIR)/mdp + install -Dm755 mdp $(PREFIX)$(DESTDIR)/mdp + +uninstall: + rm -f $(PREFIX)$(DESTDIR)/mdp -.PHONY: clean install +.PHONY: all clean install uninstall