blob: 5e83c57cd17ded057fb6f549760efdb341406cdd [file] [log] [blame]
Dan Ehrenberg5d7d7ff2015-03-04 16:00:24 -08001# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
Will Drewry80fbc6c2010-08-30 10:13:34 -05002# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
Bill Richardson75fcf622010-03-16 13:05:12 -07004
Mike Frysinger515197d2013-11-01 17:32:42 -04005CFLAGS += -Wall -Werror
Dan Ehrenberg5d7d7ff2015-03-04 16:00:24 -08006
7# Support large files and major:minor numbers
8CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
9
Mike Frysinger7642f772013-11-01 17:31:58 -040010OUT = $(CURDIR)
11$(shell mkdir -p $(OUT))
Bill Richardson75fcf622010-03-16 13:05:12 -070012
Mike Frysinger7642f772013-11-01 17:31:58 -040013all: $(OUT)/rootdev $(OUT)/librootdev.so.1.0
14
Mike Frysingercc7424d2013-11-01 17:35:24 -040015$(OUT)/rootdev: main.c $(OUT)/librootdev.so.1.0
Mike Frysinger515197d2013-11-01 17:32:42 -040016 $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
Will Drewry80fbc6c2010-08-30 10:13:34 -050017
Mike Frysinger7642f772013-11-01 17:31:58 -040018$(OUT)/librootdev.so.1.0: rootdev.c
Mike Frysinger515197d2013-11-01 17:32:42 -040019 $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC \
Mike Frysinger7642f772013-11-01 17:31:58 -040020 -Wl,-soname,librootdev.so.1 $< -o $@
21 ln -s $(@F) $(OUT)/librootdev.so.1
22 ln -s $(@F) $(OUT)/librootdev.so
Will Drewry80fbc6c2010-08-30 10:13:34 -050023
24clean:
Mike Frysinger7642f772013-11-01 17:31:58 -040025 rm -f $(OUT)/rootdev $(OUT)/librootdev.so*
Will Drewry80fbc6c2010-08-30 10:13:34 -050026
27.PHONY: clean