aboutsummaryrefslogtreecommitdiffstats
path: root/tools/internal/Makefile
blob: ac76ebbb7c4551bda557a5933a7cda2267048684 (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
33
34
35
36
CC       = gcc
CFLAGS   = -Wall -O3 
CFLAGS  += -I../../xen/include -I../../xenolinux-sparse/include

HDRS     = $(wildcard *.h)
SRCS     = $(wildcard *.c)
OBJS     = $(patsubst %.c,%.o,$(SRCS))

TARGETS  = xi_create xi_start xi_stop xi_destroy xi_build 
TARGETS += xi_phys_grant xi_phys_revoke xi_phys_probe xi_list 
TARGETS += xi_sched_global xi_sched_domain xi_usage
INSTALL  = $(TARGETS) xi_vifinit xi_helper

all: $(TARGETS)

install: all
	mkdir -p ../../../install/bin
	cp -a $(INSTALL) ../../../install/bin
	chmod 755 ../../../install/bin/xi_vifinit
	chmod 755 ../../../install/bin/xi_helper

clean:
	$(RM) *.o *.rpm $(TARGETS)

rpm: all
	rm -rf staging
	mkdir staging
	mkdir staging/i386
	rpmbuild --define "staging$$PWD/staging" --define '_builddir.' --define "_rpmdir$$PWD/staging" -bb rpm.spec
	mv staging/i386/*.rpm .
	rm -rf staging

%: %.c $(HDRS) Makefile
	$(CC) $(CFLAGS) -o $@ $<