summaryrefslogtreecommitdiffstats
path: root/isomd5sum/Makefile
blob: 654c59b5b00bfc07d8567f765b413c731a9d0f7f (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
37
38
39
40
41
42
43
44
include ../Makefile.inc

CFLAGS += -I$(PYTHONINCLUDE)  -fPIC
OBJECTS = md5.o libimplantisomd5.o checkisomd5.o pyisomd5sum.c \
	  implantisomd5 checkisomd5
SOURCES = $(patsubst %.o,%.c,$(OBJECTS))
LDFLAGS += -lpopt -fPIC

PYOBJS = pyisomd5sum.o libcheckisomd5.o libimplantisomd5.o md5.o

ifeq (.depend,$(wildcard .depend))
TARGET=all
else
TARGET=depend all
endif

all: implantisomd5 checkisomd5 pyisomd5sum.so	

%.o: %.c
	gcc -c -O $(CFLAGS) -o $@ $<

implantisomd5: implantisomd5.o md5.o libimplantisomd5.o

checkisomd5: checkisomd5.o md5.o libcheckisomd5.o

pyisomd5sum.so: $(PYOBJS)
	gcc -shared -g -o pyisomd5sum.so -fpic $(PYOBJS) $(LDFLAGS)

install:
	install -m 755 implantisomd5 $(DESTDIR)/$(RUNTIMEDIR)
	install -m 755 checkisomd5 $(DESTDIR)/$(RUNTIMEDIR)
	install -s pyisomd5sum.so $(DESTDIR)/$(RUNTIMEDIR)

clean:
	rm -f *.o *.lo *.so *.pyc .depend *~
	rm -f implantisomd5 checkisomd5 

depend:
	$(CPP) -M $(CFLAGS) -I$(PYTHONINCLUDE) *.c > .depend


ifeq (.depend,$(wildcard .depend))
include .depend
endif