Skip to content

Commit

Permalink
Makefile: install-header as dependency of install-[static|shared]
Browse files Browse the repository at this point in the history
  • Loading branch information
qyot27 authored and dwbuiten committed Jul 12, 2023
1 parent 34dee7e commit f40598f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ libobuparse.a: obuparse.o
libobuparse$(LIBSUF): obuparse.o
$(CC) $(LDFLAGS) -shared $^ -o $@

install: install-header install-shared install-static
install: install-shared install-static

install-header:
@install -d $(PREFIX)
@install -d $(PREFIX)/include
@install -v obuparse.h $(PREFIX)/include

install-shared: libobuparse$(LIBSUF)
@install -d $(PREFIX)
@test -d $(PREFIX)/include || mkdir $(PREFIX)/include
install-shared: libobuparse$(LIBSUF) install-header
@install -d $(PREFIX)/lib
@test -f $(PREFIX)/include/obuparse.h || install -v obuparse.h $(PREFIX)/include
ifneq ($(SYSTEM),MINGW)
@install -v libobuparse$(LIBSUF) $(PREFIX)/lib/libobuparse$(LIBSUF).1
@ln -sv libobuparse$(LIBSUF).1 $(PREFIX)/lib/libobuparse$(LIBSUF)
Expand All @@ -46,11 +43,8 @@ else
@install -v libobuparse$(LIBSUF) $(PREFIX)/bin/libobuparse$(LIBSUF)
endif

install-static: libobuparse.a
@install -d $(PREFIX)
@test -d $(PREFIX)/include || mkdir $(PREFIX)/include
install-static: libobuparse.a install-header
@install -d $(PREFIX)/lib
@test -f $(PREFIX)/include/obuparse.h || install -v obuparse.h $(PREFIX)/include
@install -v libobuparse.a $(PREFIX)/lib/libobuparse.a

uninstall:
Expand Down

0 comments on commit f40598f

Please sign in to comment.