]> git.tuebingen.mpg.de Git - osl.git/blobdiff - Makefile
build: Reorder make variables.
[osl.git] / Makefile
index ba61ef7769a258d2f2453d52fa5b374f54711553..8e0f163b671aaba4554cfe76a00febaa99c24fa1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -42,25 +42,12 @@ CFLAGS += -Werror-implicit-function-declaration
 CFLAGS += -Wmissing-format-attribute
 CFLAGS += -Wunused-macros
 CFLAGS += -Wbad-function-cast
+CFLAGS += -fPIC
+CFLAGS += -fvisibility=hidden
 
-# cflags used only for building library objects
-LIBCFLAGS += -fPIC
-LIBCFLAGS += -fvisibility=hidden
-
-libname := osl
-
-ifeq ($(uname_s),Linux)
-       LDFLAGS += -Wl,-soname,$(soname)
-       # disallow undefined symbols
-       LDFLAGS += -Wl,-z,defs
-endif
-ifeq ($(uname_s),NetBSD)
-       LDFLAGS += -Wl,-soname,$(soname)
-endif
-
-ifeq ($(uname_s),FreeBSD)
-       LDFLAGS += -Wl,-soname,$(soname)
-endif
+LDFLAGS += -Wl,-soname,$(soname)
+LDFLAGS += -Wl,-z,defs
+LDFLAGS += --shared
 
 # On ELf-based systems, the following conventions apply (see dhweeler's
 # Program Library HOWTO):
@@ -68,6 +55,7 @@ endif
 # The soname has the prefix ``lib'', the name of the library, the
 # phrase ``.so'', followed by a period and a version number that is
 # incremented whenever the interface changes.
+libname := osl
 soname := lib$(libname).so.$(x)
 
 # The real name adds to the soname a period, a minor number, another
@@ -78,7 +66,6 @@ realname := $(soname).$(y).$(z)
 # a library, (I'll call it the ``linker name''), which is simply the
 # soname without any version number.
 linkername := lib$(libname).so
-LDFLAGS += --shared
 
 all: $(realname) $(executables) $(man_pages)
 shared: $(realname)
@@ -87,7 +74,7 @@ ifeq ($(findstring clean, $(MAKECMDGOALS)),)
 -include $(deps)
 endif
 %.o: %.c Makefile errtab.h
-       $(CC) $(CPPFLAGS) -c -MMD -MF $(*F).d -MT $@ $(CFLAGS) $(LIBCFLAGS) $<
+       $(CC) $(CPPFLAGS) -c -MMD -MF $(*F).d -MT $@ $(CFLAGS) $<
 
 fsck.o: oslfsck.lsg.h
 oslfsck: $(fsck_objects)