enter monitor mode correctly, fixed hop_channel bug (start at channel 0)
[my-code/hdw-sniff.git] / Makefile
index 8a234aa..0503908 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,28 @@
-#!/usr/bin/make
+# Makefile of hdw-sniff
 
-CC = gcc
-CFLAGS = -O3
-LDFLAGS = -lpcap
+INCLUDEDIR = /usr/include
 
-TARGETS = hdw-sniff
+CFLAGS = -DDEBUG -O3 -Wall
+LIBS = -lpcap
 
-all: $(TARGETS)
+API_OBJS = network.o event.o input.o display.o audio.o
 
-hdw-sniff:
-       $(CC) $(CFLAGS) -Wall hdw-sniff.c $(LDFLAGS) -o hdw-sniff 
+api: links $(API_OBJS)
 
+hdw-sniff: $(API_OBJS)
+       $(CC) $(CFLAGS) -o $@ $(API_OBJS) hdw-sniff.c $(LIBS)
+all: hdw-sniff
+
+clean:
+       rm -f $(API_OBJS) {event,input,display,audio,network,list}.{c,h}
+       rm -f hdw-sniff
+
+links:
+       ln -sf ../api/event/event.{c,h} .
+       ln -sf ../api/input/input.{c,h} .
+       ln -sf ../api/display/display.{c,h} .
+       ln -sf ../api/audio/audio.{c,h} .
+       ln -sf ../api/network/network.{c,h} .
+       ln -sf ../api/list/list.{c,h} .
+
+remake: clean all