summaryrefslogtreecommitdiff
path: root/Makefile
blob: 8c960f14d1986b33895e1df72f02a67acbd423a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
CFLAGS = `pkg-config --cflags gtk+-2.0 libglade-2.0` -Wall -g
LIBS = `pkg-config --libs gtk+-2.0 libglade-2.0` -lbfd -liberty
C_FILES = sysprof.c binfile.c stackstash.c watch.c process.c profile.c treeviewutils.c
OBJS = $(addsuffix .o, $(basename $(C_FILES)))
BINARY = sysprof
MODULE    := sysprof-module
INCLUDE   := -isystem /lib/modules/`uname -r`/build/include
MODCFLAGS := -O2 -DMODULE -D__KERNEL__ -Wall ${INCLUDE}


all: $(BINARY) $(MODULE).o

$(BINARY): $(OBJS) depend
	gcc $(OBJS) $(LIBS) -o$(BINARY)
clean:
	rm -f $(OBJS) $(BINARY) $(MODULE).o *~ core* depend.mk

depend:	
	$(CC) -MM $(CFLAGS) $(C_FILES) > depend.mk

depend.mk:
	touch depend.mk
	$(MAKE) depend

include depend.mk

.PHONY: depend all


$(MODULE).o: $(MODULE).c
	gcc $(MODCFLAGS) $(MODULE).c -c -o$(MODULE).o