2011-03-20 19:18:19 +01:00
|
|
|
############################################################################
|
2022-03-08 23:05:12 +01:00
|
|
|
# apps/examples/nxflat/tests/hello/Makefile
|
2011-03-20 19:18:19 +01:00
|
|
|
#
|
2021-06-07 17:31:08 +02:00
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership. The
|
|
|
|
# ASF licenses this file to you 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
|
2011-03-20 19:18:19 +01:00
|
|
|
#
|
2021-06-07 17:31:08 +02:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2011-03-20 19:18:19 +01:00
|
|
|
#
|
2021-06-07 17:31:08 +02:00
|
|
|
# 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.
|
2011-03-20 19:18:19 +01:00
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2020-05-20 06:35:03 +02:00
|
|
|
include $(APPDIR)/Make.defs
|
2011-03-20 19:18:19 +01:00
|
|
|
|
|
|
|
BIN = struct
|
|
|
|
|
|
|
|
R1SRCS = struct_main.c struct_dummy.c
|
|
|
|
R1OBJS = $(R1SRCS:.c=.o)
|
|
|
|
|
|
|
|
R2SRC = $(BIN)-thunk.S
|
|
|
|
R2OBJ = $(R2SRC:.S=.o)
|
|
|
|
|
|
|
|
all: $(BIN)
|
|
|
|
|
|
|
|
$(R1OBJS): %.o: %.c
|
|
|
|
@echo "CC: $<"
|
2012-11-17 19:54:53 +01:00
|
|
|
$(Q) $(CC) -c $(CPICFLAGS) $< -o $@
|
2011-03-20 19:18:19 +01:00
|
|
|
|
|
|
|
$(R2OBJ): %.o: %.S
|
|
|
|
@echo "AS: $<"
|
2012-11-17 19:54:53 +01:00
|
|
|
$(Q) $(CC) -c $(CPICFLAGS) $< -o $@
|
2011-03-20 19:18:19 +01:00
|
|
|
|
|
|
|
$(BIN).r1: $(R1OBJS)
|
|
|
|
@echo "LD: $<"
|
2012-11-17 19:54:53 +01:00
|
|
|
$(Q) $(LD) $(NXFLATLDFLAGS1) -o $@ $^
|
2011-03-20 19:18:19 +01:00
|
|
|
|
|
|
|
$(R2SRC): $(BIN).r1
|
|
|
|
@echo "MK: $<"
|
2012-11-17 19:54:53 +01:00
|
|
|
$(Q) $(MKNXFLAT) -o $@ $^
|
2011-03-20 19:18:19 +01:00
|
|
|
|
|
|
|
$(BIN).r2: $(R2OBJ)
|
|
|
|
@echo "LD: $<"
|
2012-11-17 19:54:53 +01:00
|
|
|
$(Q) $(LD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ)
|
2011-03-20 19:18:19 +01:00
|
|
|
|
|
|
|
$(BIN): $(BIN).r2
|
|
|
|
@echo "LD: $<"
|
2012-11-17 19:54:53 +01:00
|
|
|
$(Q) $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^
|
2011-03-20 19:18:19 +01:00
|
|
|
|
2020-03-16 10:12:16 +01:00
|
|
|
$(ROMFS_DIR)/$(BIN): $(BIN)
|
|
|
|
$(Q) install -D $(BIN) $(ROMFS_DIR)/$(BIN)
|
|
|
|
|
|
|
|
install: $(ROMFS_DIR)/$(BIN)
|
|
|
|
|
2014-04-14 00:24:28 +02:00
|
|
|
clean:
|
2012-11-20 16:47:41 +01:00
|
|
|
$(call DELFILE, $(BIN))
|
|
|
|
$(call DELFILE, $(R2SRC))
|
|
|
|
$(call DELFILE, *.r1)
|
|
|
|
$(call DELFILE, *.r2)
|
2012-11-17 19:54:53 +01:00
|
|
|
$(call CLEAN)
|