vishwa | 5c912c8 | 2016-03-24 07:59:28 -0500 | [diff] [blame] | 1 | CC?= $(CROSS_COMPILE)gcc |
| 2 | |
| 3 | EXE = netman_watch_dns |
| 4 | EXE_OBJ = $(EXE).o |
| 5 | |
| 6 | INSTALLED_EXE += $(EXE) |
| 7 | |
| 8 | CFLAGS += -Wall -Wno-unused-result |
| 9 | |
| 10 | INC_FLAG += $(shell pkg-config --cflags --libs libsystemd) -I. -O2 |
| 11 | LIB_FLAG += $(shell pkg-config --libs libsystemd) |
| 12 | |
| 13 | DESTDIR ?= / |
| 14 | SBINDIR ?= /usr/sbin |
| 15 | |
| 16 | all: $(EXE) |
| 17 | |
| 18 | %.o: %.C |
| 19 | $(CC) -c $< $(CFLAGS) $(INC_FLAG)-o $@ |
| 20 | |
| 21 | $(EXE): $(EXE_OBJ) |
| 22 | $(CC) $^ $(LDFLAGS) $(LIB_FLAG) -o $@ |
| 23 | |
| 24 | clean: |
| 25 | rm -f $(EXE) *.o |
| 26 | |
| 27 | install: |
| 28 | install -m 0755 -d $(DESTDIR)$(SBINDIR) |
| 29 | install -m 0755 $(EXE) $(DESTDIR)$(SBINDIR) |