--- Makefile.orig 2007-02-19 12:14:08 UTC +++ Makefile @@ -30,9 +30,9 @@ MAP = lib$(PROJECT).map TARGETS = $(PROJECT) $(SHAREDLIB) $(STATICLIB) INSTALL = install -libdir = /usr/lib -libexecdir = /usr/lib -includedir = /usr/include +libdir = $(PREFIX)/lib +libexecdir = $(PREFIX)/libexec +includedir = $(PREFIX)/include DESTDIR = WARNINGS = -W -Wall -Waggregate-return -Wcast-align -Wconversion \ @@ -40,8 +40,8 @@ WARNINGS = -W -Wall -Waggregate-return - -Wmissing-format-attribute -Wmissing-noreturn \ -Wmissing-prototypes -Wpointer-arith -Wredundant-decls \ -Wshadow -Wstrict-prototypes -Wwrite-strings -CPPFLAGS = -std=gnu99 $(WARNINGS) -DLIBEXECDIR=\"$(libexecdir)\" -CFLAGS = $(RPM_OPT_FLAGS) +CPPFLAGS = -std=gnu99 $(WARNINGS) +CFLAGS+= -DLIBEXECDIR=\"$(libexecdir)\" LDLIBS = all: $(TARGETS) @@ -63,15 +63,20 @@ $(STATICLIB): iface.o iface.o: iface.c utempter.h +$(PROJECT).o: $(PROJECT).c + +$(PROJECT): $(PROJECT).o + $(LINK.o) $(PROJECT).o -o $(PROJECT) -lutil + install: mkdir -p $(DESTDIR)$(libexecdir)/$(PROJECT) $(DESTDIR)$(includedir) \ $(DESTDIR)$(libdir) - $(INSTALL) -p -m2711 $(PROJECT) $(DESTDIR)$(libexecdir)/$(PROJECT)/ - $(INSTALL) -p -m644 $(PROJECT).h $(DESTDIR)$(includedir)/ - $(INSTALL) -p -m755 $(SHAREDLIB) $(DESTDIR)$(libdir)/$(SHAREDLIB).$(VERSION) - $(INSTALL) -p -m644 $(STATICLIB) $(DESTDIR)$(libdir)/ - ln -s $(SHAREDLIB).$(VERSION) $(DESTDIR)$(libdir)/$(SONAME) - ln -s $(SONAME) $(DESTDIR)$(libdir)/$(SHAREDLIB) + $(INSTALL) -m4711 $(PROJECT) $(DESTDIR)$(libexecdir)/$(PROJECT)/$(PROJECT) + $(INSTALL) -m644 $(PROJECT).h $(DESTDIR)$(includedir)/$(PROJECT).h + $(INSTALL) -m755 $(SHAREDLIB) $(DESTDIR)$(libdir)/$(SHAREDLIB).$(VERSION) + $(INSTALL) -m644 $(STATICLIB) $(DESTDIR)$(libdir)/$(STATICLIB) + ln -sf $(SHAREDLIB).$(VERSION) $(DESTDIR)$(libdir)/$(SONAME) + ln -sf $(SONAME) $(DESTDIR)$(libdir)/$(SHAREDLIB) clean: - $(RM) $(TARGETS) iface.o iface.os core *~ + $(RM) $(TARGETS) $(PROJECT).o iface.o iface.os core *~