pinosaur
/
smdp.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #21 from ungureanuvladvictor/generic_folder_structure
[smdp.git]
/
Makefile
diff --git
a/Makefile
b/Makefile
index
46ed432
..
f922b7e
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-18,40
+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 = -O3 -Wall
-
-ifeq ($(DEBUG),1)
-CFLAGS := -O0 -Wall -g
-LDFLAGS :=
-endif
-
OSTYPE := $(shell uname -o)
CURSES = ncursesw
ifeq (Windows_NT, $(OS))
ifneq (Cygwin, $(OSTYPE))
CURSES := pdcurses
OSTYPE := $(shell uname -o)
CURSES = ncursesw
ifeq (Windows_NT, $(OS))
ifneq (Cygwin, $(OSTYPE))
CURSES := pdcurses
-CFLAGS += -DWIN32=1
endif
endif
LDFLAGS = -s
LDLIBS = -l$(CURSES)
endif
endif
LDFLAGS = -s
LDLIBS = -l$(CURSES)
-OBJECTS = cstring.o cstack.o markdown.o parser.o viewer.o mdp.o
+SOURCES = $(wildcard src/*.c)
+OBJECTS = $(SOURCES:.c=.o)
+TARGET = mdp
DESTDIR = /usr/bin
DESTDIR = /usr/bin
-all: mdp
+ifeq ($(DEBUG),1)
+LDFLAGS :=
+endif
+
+all: $(TARGET)
+
+$(TARGET): src
+ $(CC) $(OBJECTS) $(LDLIBS) $(LDFLAGS) -o $(TARGET)
-mdp: $(OBJECTS)
+src:
+ $(MAKE) $(MFLAGS) -C src
clean:
clean:
- $(RM) $(OBJECTS) mdp
+ $(MAKE) -C src clean
+ $(RM) $(TARGET)
-install:
mdp
+install:
install -d $(PREFIX)$(DESTDIR)
install -d $(PREFIX)$(DESTDIR)
- install -m 755 mdp $(PREFIX)$(DESTDIR)/
mdp
+ install -m 755 mdp $(PREFIX)$(DESTDIR)/
$(TARGET)
uninstall:
uninstall:
- $(RM) $(PREFIX)$(DESTDIR)/
mdp
+ $(RM) $(PREFIX)$(DESTDIR)/
$(TARGET)
-.PHONY: all clean install uninstall
+.PHONY: all clean install
src
uninstall