2015-06-02 18:45:48 +02:00
|
|
|
############################################################################
|
|
|
|
# apps/examples/thttpd/content/Makefile.binfs
|
|
|
|
#
|
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
|
2015-06-02 18:45:48 +02:00
|
|
|
#
|
2021-06-07 17:31:08 +02:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2015-06-02 18:45:48 +02: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.
|
2015-06-02 18:45:48 +02:00
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2020-05-20 06:35:03 +02:00
|
|
|
include $(APPDIR)/Make.defs
|
2015-06-02 18:45:48 +02:00
|
|
|
|
2019-10-06 14:14:39 +02:00
|
|
|
PROGNAME = hello tasks
|
2015-06-02 18:45:48 +02:00
|
|
|
PRIORITY = $(CONFIG_THTTPD_CGI_PRIORITY)
|
|
|
|
STACKSIZE = $(CONFIG_THTTPD_CGI_STACKSIZE)
|
|
|
|
|
2023-09-07 15:09:42 +02:00
|
|
|
MAINSRC = hello.c tasks.c
|
2015-06-02 18:45:48 +02:00
|
|
|
|
2020-07-29 06:28:00 +02:00
|
|
|
DEPPATH += --dep-path hello --dep-path tasks
|
2018-09-03 17:29:56 +02:00
|
|
|
VPATH += :hello:tasks
|
2015-06-02 18:45:48 +02:00
|
|
|
|
2020-03-23 18:40:44 +01:00
|
|
|
include $(APPDIR)/Application.mk
|
2015-06-06 20:39:57 +02:00
|
|
|
|
2020-03-23 18:40:44 +01:00
|
|
|
THTTPD_DIR = $(APPDIR)/examples/thttpd
|
|
|
|
CONTENT_DIR = $(THTTPD_DIR)/content
|
|
|
|
ROMFS_DIR = $(CONTENT_DIR)/romfs
|
|
|
|
ROMFS_IMG = $(CONTENT_DIR)/romfs.img
|
2020-05-14 05:32:35 +02:00
|
|
|
ROMFS_SRC = $(CONTENT_DIR)/romfs.c
|
2015-06-06 20:39:57 +02:00
|
|
|
|
|
|
|
# Populate the romfs directory
|
|
|
|
|
|
|
|
$(ROMFS_DIR)/index.html : $(CONTENT_DIR)/index.html
|
2020-03-23 18:40:44 +01:00
|
|
|
$(Q) mkdir -p $(ROMFS_DIR)
|
|
|
|
$(Q) cp -a $< $@ || { echo "cp of index.html failed"; exit 1; }
|
2015-06-06 20:39:57 +02:00
|
|
|
|
|
|
|
$(ROMFS_DIR)/style.css : $(CONTENT_DIR)/style.css
|
2020-03-23 18:40:44 +01:00
|
|
|
$(Q) mkdir -p $(ROMFS_DIR)
|
|
|
|
$(Q) cp -a $< $@ || { echo "cp of $< failed"; exit 1; }
|
2015-06-06 20:39:57 +02:00
|
|
|
|
|
|
|
# Create the romfs.img file from the populated romfs directory
|
|
|
|
|
2020-03-23 18:40:44 +01:00
|
|
|
$(ROMFS_IMG): $(ROMFS_DIR)/index.html $(ROMFS_DIR)/style.css
|
|
|
|
$(Q) genromfs -f $@ -d $(ROMFS_DIR) -V "THTTPDTEST"
|
2015-06-06 20:39:57 +02:00
|
|
|
|
2020-05-14 05:32:35 +02:00
|
|
|
# Create the romfs.c file from the romfs.img file
|
2015-06-06 20:39:57 +02:00
|
|
|
|
2020-05-14 05:32:35 +02:00
|
|
|
$(ROMFS_SRC): $(ROMFS_IMG)
|
2022-01-27 15:32:39 +01:00
|
|
|
$(Q) (cd $(CONTENT_DIR) && echo "#include <nuttx/compiler.h>" >$@ && \
|
|
|
|
xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char aligned_data(4)/g" >>$@)
|
2015-06-06 20:39:57 +02:00
|
|
|
|
2020-05-14 05:32:35 +02:00
|
|
|
all:: $(ROMFS_SRC)
|
2015-06-02 18:45:48 +02:00
|
|
|
|
2018-09-03 17:29:56 +02:00
|
|
|
clean::
|
2020-05-14 05:32:35 +02:00
|
|
|
$(call DELFILE, $(ROMFS_SRC))
|
2015-06-06 20:39:57 +02:00
|
|
|
$(call DELFILE, $(ROMFS_IMG))
|
2020-03-23 18:40:44 +01:00
|
|
|
$(Q) rm -rf $(ROMFS_DIR)
|