This repository has been archived by the owner on Jan 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
cron.mk
85 lines (63 loc) · 2.24 KB
/
cron.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Ming C (Vincent) Li - Jan 29 2008
# mchun.li at gmail dot com
#
# See files/crontab for some usage hints and uClinux-dist/usr/cron/README
# for more information.
include rules.mk
CRON_VERSION=1.0
CRON_NAME=cron
CRON_DIR=$(UCLINUX_DIST)/user/$(CRON_NAME)
CRON_BUILD_DIR=$(UCLINUX_DIST)/user/$(CRON_NAME)
TARGET_DIR=$(TOPDIR)/tmp/cron/ipkg/cron
PKG_NAME:=cron
PKG_VERSION:=$(CRON_VERSION)
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(TOPDIR)/tmp/cron
STAGING_INC=$(STAGING_DIR)/usr/include
STAGING_LIB=$(STAGING_DIR)/usr/lib
CRON_CFLAGS=-O2 -Wall -D__uClinux__ -DEMBED -fno-builtin -mfdpic \
-I$(UCLINUX_DIST) -isystem $(STAGING_INC) -isystem $(STAGING_INC)
cron: $(CRON_BUILD_DIR)/cron.o $(CRON_BUILD_DIR)/cron-parent.o
bfin-linux-uclibc-gcc -mfdpic -B$(STAGING_LIB) -L$(STAGING_LIB) -o $(CRON_BUILD_DIR)/cron $^
rm -Rf $(TARGET_DIR)
mkdir -p $(TARGET_DIR)
mkdir -p $(TARGET_DIR)/bin
cp -v $(CRON_BUILD_DIR)/cron $(TARGET_DIR)/bin/
mkdir -p $(TARGET_DIR)/etc/init.d/
cp files/cron.init $(TARGET_DIR)/etc/init.d/cron
chmod a+x $(TARGET_DIR)/etc/init.d/cron
mkdir -p $(TARGET_DIR)/etc/config/
cp files/crontab $(TARGET_DIR)/etc/config/crontab
touch $(PKG_BUILD_DIR)/.built
all: cron
$(CRON_BUILD_DIR)/cron.o: $(CRON_BUILD_DIR)/cron.c $(CRON_BUILD_DIR)/bitstring.h
bfin-linux-uclibc-gcc $(CRON_CFLAGS) -c -o $@ $<
$(CRON_BUILD_DIR)/cron-parent.o: $(CRON_BUILD_DIR)/cron-parent.c
bfin-linux-uclibc-gcc $(CRON_CFLAGS) -c -o $@ $<
distclean:
-rm -f $(CRON_BUILD_DIR)/cron $(CRON_BUILD_DIR)/*.o
.PHONY: all distclean
#---------------------------------------------------------------------------
# CREATING PACKAGE
#---------------------------------------------------------------------------
define Package/cron
SECTION:=core
CATEGORY:=Applications
TITLE:=CRON
DESCRIPTION:=\
CRON is a small version of the cron daemon.
URL:=http://www.gnu.org/software/gcron/main.html
ARCHITECTURE:=bfin-uclinux
endef
# post installation - add the sym link for auto start
define Package/cron/postinst
#!/bin/sh
/etc/init.d/cron enable
endef
# pre-remove - remove sym link
define Package/cron/prerm
#!/bin/sh
/etc/init.d/cron disable
endef
$(eval $(call BuildPackage,cron))
cron-package: cron $(PACKAGE_DIR)/cron_$(VERSION)_$(PKGARCH).ipk