akmhoque | 8adb43b | 2012-08-09 12:37:33 -0500 | [diff] [blame] | 1 | CC = cc |
akmhoque | 3cced64 | 2012-09-24 16:20:20 -0500 | [diff] [blame] | 2 | CFLAGS = -g -Wall -Wpointer-arith -Wreturn-type -Wstrict-prototypes |
akmhoque | cfac778 | 2012-09-26 10:36:01 -0500 | [diff] [blame] | 3 | LIBS = -lccn -lcrypto |
akmhoque | 8adb43b | 2012-08-09 12:37:33 -0500 | [diff] [blame] | 4 | |
akmhoque | 1771c41 | 2012-11-09 13:06:08 -0600 | [diff] [blame] | 5 | PROGRAMS = nlsrc nlsr |
akmhoque | cfac778 | 2012-09-26 10:36:01 -0500 | [diff] [blame] | 6 | INSTALL_PATH=/usr/local/bin/ |
| 7 | |
| 8 | NLSR_SRCS=nlsr.c nlsr_ndn.c nlsr_npl.c nlsr_adl.c nlsr_lsdb.c nlsr_route.c nlsr_npt.c nlsr_fib.c utility.c |
akmhoque | 1771c41 | 2012-11-09 13:06:08 -0600 | [diff] [blame] | 9 | NLSRC_SRCS=nlsrc.c |
akmhoque | 8adb43b | 2012-08-09 12:37:33 -0500 | [diff] [blame] | 10 | |
| 11 | all: $(PROGRAMS) |
| 12 | |
akmhoque | cfac778 | 2012-09-26 10:36:01 -0500 | [diff] [blame] | 13 | nlsr: $(NLSR_SRCS) |
akmhoque | 9190f4f | 2012-10-05 08:10:28 -0500 | [diff] [blame] | 14 | $(CC) $(CFLAGS) $(NLSR_SRCS) -o nlsr $(LIBS) -lm |
akmhoque | cfac778 | 2012-09-26 10:36:01 -0500 | [diff] [blame] | 15 | |
akmhoque | 1771c41 | 2012-11-09 13:06:08 -0600 | [diff] [blame] | 16 | nlsrc: $(NLSRC_SRCS) |
| 17 | $(CC) $(CFLAGS) $(NLSRC_SRCS) -o nlsrc $(LIBS) -lm |
| 18 | |
akmhoque | cfac778 | 2012-09-26 10:36:01 -0500 | [diff] [blame] | 19 | install: $(PROGRAMS) |
| 20 | cp $(PROGRAMS) $(INSTALL_PATH) |
| 21 | cd $(INSTALL_PATH); chown root:0 $(PROGRAMS); chmod 755 $(PROGRAMS) |
| 22 | |
| 23 | uninstall: |
| 24 | cd $(INSTALL_PATH); rm -f $(PROGRAMS) |
akmhoque | 8adb43b | 2012-08-09 12:37:33 -0500 | [diff] [blame] | 25 | |
| 26 | clean: |
| 27 | rm -f *.o |
| 28 | rm -f $(PROGRAMS) |
akmhoque | fb7d0bc | 2013-01-16 19:17:45 -0600 | [diff] [blame] | 29 | rm -rf *.dSYM |
akmhoque | 8adb43b | 2012-08-09 12:37:33 -0500 | [diff] [blame] | 30 | |
| 31 | .c.o: |
| 32 | $(CC) $(CFLAGS) -c $< |
| 33 | |
| 34 | .PHONY: all clean |