summaryrefslogtreecommitdiffstats
path: root/gptsync/Makefile
blob: c08a7745d7324fa7fdc49066b809f1f4c0dd70d2 (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
45
46
47
48
49
50
51
52
#
# Makefile for gptsync on Unix platforms
#


TARGETS	  = gptsync showpart
OBJS	  = showpart.c lib.c os_unix.c gptsync.c

CPPFLAGS = $(CFLAGS)
#CPPFLAGS = $(shell echo $(CFLAGS) | sed -e 's/-O2/-O0/g' -e 's/-g /-ggdb3 /g') 
CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
LDFLAGS   =
LIBS      =
CC	  = gcc

include ../Makefile.inc

# real making

all: $(TARGETS)

gptsync: gptsync.o lib.o
	$(CC) $(CPPFLAGS) $(LDFLAGS) -DPROGNAME=$@ -o $@ os_unix.c $^ $(LIBS)

showpart: showpart.o lib.o
	$(CC) $(CPPFLAGS) $(LDFLAGS) -DPROGNAME=$@ -o $@ os_unix.c $^ $(LIBS)

%.o: %.c
	$(CC) $(CPPFLAGS) -c -o $@ $<

# cleanup

clean:
	$(RM) *.o *~ *% $(TARGETS) .depend

# automatic dependencies

depend: dep
dep:
	for i in $(OBJS:.o=.c) ; do $(CC) $(CPPFLAGS) -MM $$i ; done > .depend

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

# eof

# install target for anaconda
install: all
	mkdir -p $(DESTDIR)/usr/sbin
	install -m 755 gptsync $(DESTDIR)/usr/sbin/gptsync
	install -m 755 showpart $(DESTDIR)/usr/sbin/showpart