developer | 55ac2c3 | 2024-05-06 14:31:19 +0800 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | # |
| 3 | |
| 4 | # Include directories |
| 5 | INCLUDES := -Iexample/cli/cmds \ |
| 6 | -Iexample/cli/ \ |
| 7 | -Iexample/fapi \ |
| 8 | -Iexample/os \ |
| 9 | -Iexample \ |
| 10 | -Iswitch_hostapi/include/gpy \ |
| 11 | -Iswitch_hostapi/include/gswip \ |
| 12 | -Iswitch_hostapi/src \ |
| 13 | -Iswitch_ioctl/src |
| 14 | |
| 15 | # Source files |
| 16 | SRCS := $(wildcard example/cli/cmds/*.c) \ |
| 17 | $(wildcard example/cli/*.c) \ |
| 18 | $(wildcard example/fapi/*.c) \ |
| 19 | $(wildcard switch_ioctl/src/*.c) \ |
| 20 | switch_hostapi/src/gsw_api.c \ |
| 21 | switch_hostapi/src/gsw_cli_common.c \ |
| 22 | switch_hostapi/src/host_adapt.c \ |
| 23 | switch_hostapi/src/host_api_impl.c \ |
| 24 | switch_hostapi/src/host_smdio_ssb.c \ |
| 25 | switch_hostapi/src/mdio_relay.c \ |
| 26 | switch_hostapi/src/sys_misc.c |
| 27 | |
| 28 | # Define the C object files |
| 29 | OBJS := $(SRCS:.c=.o) |
| 30 | |
| 31 | # Define the name of the executable file |
| 32 | TARGET := ethswbox |
| 33 | |
| 34 | .PHONY: clean |
| 35 | |
| 36 | all: $(TARGET) |
| 37 | |
| 38 | $(TARGET): $(OBJS) |
| 39 | $(CC) $(LDFLAGS) -o $@ $^ |
| 40 | |
| 41 | %.o: %.c |
| 42 | $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ |
| 43 | |
| 44 | clean: |
| 45 | rm -f $(OBJS) $(TARGET) |