pinosaur
/
smdp.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update sample for unordered list.
[smdp.git]
/
Makefile
diff --git
a/Makefile
b/Makefile
index
de3c650
..
f922b7e
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-18,22
+18,43
@@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-CFLAGS = -Wall -g
-LDLIBS = -lncurses
-OBJECTS = cstring.o cstack.o markdown.o parser.o viewer.o mdp.o
-DESTDIR ?= /usr/bin
+OSTYPE := $(shell uname -o)
+CURSES = ncursesw
+ifeq (Windows_NT, $(OS))
+ifneq (Cygwin, $(OSTYPE))
+CURSES := pdcurses
+endif
+endif
-all: mdp
+LDFLAGS = -s
+LDLIBS = -l$(CURSES)
+SOURCES = $(wildcard src/*.c)
+OBJECTS = $(SOURCES:.c=.o)
+TARGET = mdp
+DESTDIR = /usr/bin
-mdp: $(OBJECTS)
+ifeq ($(DEBUG),1)
+LDFLAGS :=
+endif
+
+all: $(TARGET)
+
+$(TARGET): src
+ $(CC) $(OBJECTS) $(LDLIBS) $(LDFLAGS) -o $(TARGET)
+
+src:
+ $(MAKE) $(MFLAGS) -C src
clean:
clean:
- $(RM) $(OBJECTS) mdp
+ $(MAKE) -C src clean
+ $(RM) $(TARGET)
-install: mdp
- if which strip 1>/dev/null 2>&1; then strip mdp; fi
+install:
install -d $(PREFIX)$(DESTDIR)
install -d $(PREFIX)$(DESTDIR)
- install -m 755 mdp $(PREFIX)$(DESTDIR)/mdp
+ install -m 755 mdp $(PREFIX)$(DESTDIR)/$(TARGET)
+
+uninstall:
+ $(RM) $(PREFIX)$(DESTDIR)/$(TARGET)
-.PHONY: all clean install
+.PHONY: all clean install
src uninstall