summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2012-11-25 21:15:35 +0100
committerPali Rohár <pali.rohar@gmail.com>2012-11-25 21:15:35 +0100
commit1edbc5e52e48c95a80469a6fb4e0907baa70cbd8 (patch)
treeab94838cb73276b052a66c470b6f121f9670fa0c
parent0629204d397174f7abf8a508b070902b8da627bd (diff)
download0xFFFF-1edbc5e52e48c95a80469a6fb4e0907baa70cbd8.tar.bz2
Update Makefiles
-rw-r--r--Makefile24
-rw-r--r--config.mk2
-rw-r--r--src/Makefile13
3 files changed, 14 insertions, 25 deletions
diff --git a/Makefile b/Makefile
index 97fdc3a..8c71c57 100644
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,2 @@
-include config.mk
-PREFIX?=/usr/local
-DESTDIR?=
-
-all:
- cd src && ${MAKE} all
-
-static:
- cd src && ${MAKE} static
-
-allusb:
- cd src && ${MAKE} allusb
-
-clean:
- cd src && ${MAKE} clean
-
-install:
- mkdir -p ${DESTDIR}${PREFIX}/bin
- cp src/0xFFFF ${DESTDIR}${PREFIX}/bin
-
-deinstall:
- rm -f ${DESTDIR}${PREFIX}/bin/0xFFFF
+all clean install uninstall:
+ $(MAKE) -C src $@
diff --git a/config.mk b/config.mk
index e401680..158d300 100644
--- a/config.mk
+++ b/config.mk
@@ -2,5 +2,5 @@ VERSION = 0.6
PREFIX = /usr/local
# NetBSD stuff
-#CFLAGS += -I/usr/pkg/include -g -O2
+#CPPFLAGS += -I/usr/pkg/include
#LDFLAGS += -L/usr/pkg/lib -Wl,-R/usr/pkg/lib
diff --git a/src/Makefile b/src/Makefile
index 601568a..3d92896 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,6 +1,9 @@
include ../config.mk
-CPPFLAGS += -DVERSION=\"$(VERSION)\" -D_GNU_SOURCE -I.
+DESTDIR ?= /
+PREFIX ?= /usr/local
+
+CPPFLAGS += -DVERSION=\"$(VERSION)\" -D_GNU_SOURCE
CFLAGS += -W -Wall -O2 -pedantic -std=c99
LIBS += -lm -lusb
@@ -15,5 +18,11 @@ $(BIN): $(OBJS) Makefile ../config.mk
%.o: %.c Makefile ../config.mk
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+install:
+ $(INSTALL) -m 755 $(BIN) $(DESTDIR)$(PREFIX)/bin/
+
+uninstall:
+ $(RM) $(DESTDIR)$(PREFIX)/bin/$(BIN)
+
clean:
- -rm -f $(OBJS) $(BIN)
+ -$(RM) $(OBJS) $(BIN)