Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d55c0d8 authored by Steve Kondik's avatar Steve Kondik
Browse files

sdcard: Allow building as a static library

 * Split main() out in order to allow linking with a multi-call
   executable such as recovery.

Change-Id: I3325135e47e4dd5af3912f5ce67ec64007d54a63
parent 09e8d92e
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_SRC_FILES := sdcard.c
LOCAL_MODULE:= sdcard
LOCAL_MODULE := libsdcard
LOCAL_CFLAGS := -Wall -Wno-unused-parameter
LOCAL_MODULE_TAGS := optional
include $(BUILD_STATIC_LIBRARY)

LOCAL_SHARED_LIBRARIES := libc

include $(CLEAR_VARS)
LOCAL_SRC_FILES := main.c
LOCAL_MODULE := sdcard
LOCAL_CFLAGS := -Wall -Wno-unused-parameter
LOCAL_STATIC_LIBRARIES := libsdcard
include $(BUILD_EXECUTABLE)

sdcard/main.c

0 → 100644
+21 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2010 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

extern int sdcard_main(int argc, char **argv);

int main(int argc, char **argv) {
    return sdcard_main(argc, argv);
}
+1 −1
Original line number Diff line number Diff line
@@ -1298,7 +1298,7 @@ error:
    return res;
}

int main(int argc, char **argv)
int sdcard_main(int argc, char **argv)
{
    int res;
    const char *source_path = NULL;