Alexander Afanasyev | 0ac7078 | 2013-08-14 16:49:34 -0700 | [diff] [blame] | 1 | diff --git Makefile Makefile |
| 2 | new file mode 100644 |
| 3 | index 0000000..2836550 |
| 4 | --- /dev/null |
| 5 | +++ Makefile |
| 6 | @@ -0,0 +1,5 @@ |
| 7 | + |
| 8 | +all install clean uninstall: .always |
| 9 | + (cd source; make $@) |
| 10 | + |
| 11 | +.always: |
| 12 | diff --git source/Makefile source/Makefile |
| 13 | index f6fba70..8531b0a 100644 |
| 14 | --- source/Makefile |
| 15 | +++ source/Makefile |
| 16 | @@ -1,31 +1,27 @@ |
| 17 | -CC = gcc |
| 18 | -CFLAGS = -g -Wall -Wpointer-arith -Wreturn-type -Wstrict-prototypes |
| 19 | LIBS = -lndn -lcrypto |
| 20 | |
| 21 | PROGRAM_CL = trace |
| 22 | PROGRAM_SR = ndn_traced |
| 23 | |
| 24 | -INSTALL_DIR=/usr/local/bin |
| 25 | - |
| 26 | all: $(PROGRAM_CL) $(PROGRAM_SR) |
| 27 | |
| 28 | trace: trace_client.o |
| 29 | - $(CC) $(CFLAGS) -o trace trace_client.o $(LIBS) |
| 30 | + $(CC) $(CFLAGS) $(LDFLAGS) -o trace trace_client.o $(LIBS) |
| 31 | |
| 32 | trace_client.o: |
| 33 | $(CC) $(CFLAGS) -c trace_client.c |
| 34 | |
| 35 | ndn_traced: trace_server.o |
| 36 | - $(CC) $(CFLAGS) -o ndn_traced trace_server.o $(LIBS) |
| 37 | + $(CC) $(CFLAGS) $(LDFLAGS) -o ndn_traced trace_server.o $(LIBS) |
| 38 | |
| 39 | trace_server.o: |
| 40 | $(CC) $(CFLAGS) -c trace_server.c |
| 41 | |
| 42 | install: |
| 43 | - install -m 0755 $(PROGRAM_CL) $(PROGRAM_SR) $(INSTALL_DIR) |
| 44 | + install -m 0755 $(PROGRAM_CL) $(PROGRAM_SR) $(DESTDIR)$(INSTALL_DIR)/bin |
| 45 | |
| 46 | uninstall: |
| 47 | - rm -f $(INSTALL_DIR)/$(PROGRAM_CL) $(INSTALL_DIR)/$(PROGRAM_SR) |
| 48 | + rm -f $(DESTDIR)$(INSTALL_DIR)/bin/$(PROGRAM_CL) $(DESTDIR)$(INSTALL_DIR)/bin/$(PROGRAM_SR) |
| 49 | |
| 50 | clean: |
| 51 | rm -f *.o |