X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=Makefile;h=1d4ce07d9685fd4333e054ae051635a7f3e8e3c7;hb=2c77b5e6e665dcce85cc22d7673573c46137593d;hp=d4df0d5060ea35f36934ae6f380ca8278fc330cf;hpb=d4843ea375360f37e965709e73c0fbd68e302dca;p=smdp.git diff --git a/Makefile b/Makefile index d4df0d5..1d4ce07 100644 --- a/Makefile +++ b/Makefile @@ -18,27 +18,30 @@ # 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 -.PHONY: clean install +uninstall: + rm -f $(PREFIX)$(DESTDIR)/mdp + +.PHONY: all clean install uninstall