Here's an abbreviated version of my makefile
# if 0 then Debian
TS7400 = 1
OPT_DIR = /usr/local/opt
KERNEL = DEBIAN
ifeq "$(TS7400)" "1"
PCB = TS7400_BOARD
CPU = ARM
GNU_DIR = $(OPT_DIR)/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2
LINUX_INC = $(OPT_DIR)/ts7400-32-128F/dist/linux24/include
AS_NAME = arm-linux-as
GCC_NAME = arm-linux-gcc
LD_NAME = arm-linux-ld
else
PCB = DEBIAN_I386_PC
CPU = I386
GNU_DIR = /usr
LINUX_INC = $(GNU_DIR)/include
AS_NAME = as
GCC_NAME = gcc
LD_NAME = ld
endif
GNU_TOOLS = $(GNU_DIR)/bin
GLIBC_INC = $(GNU_DIR)/include
LIB_DIR = $(GNU_DIR)/lib
WD = $(shell pwd)
WD_INCLUDE = $(WD)/include
CGI_DIR = /usr/lib/cgi-bin
SRC_DIR = $(WD)/src
COMMON_INC = ../common_II/v1.0.0/include
DAEMON_INC = ../daemon/include
TEST_INC = ../daemon/test/testDaemon
INC_DIR = -I$(WD_INCLUDE) -I$(LINUX_INC) -I$(GLIBC_INC) -I$(COMMON_INC)
-I$(DAEMON_INC) -I$(TEST_INC)
CFLAGS = -Wall
CFLAGS += -g
CFLAGS += -mcpu=arm9
CFLAGS += -O0
CFLAGS += -D_MULTI_THREADED -D__REENTRANT -D__USE_SVID
CFLAGS += -DCM_II -DARCH=1 -D$(PCB) -D$(CPU)
CFLAGS += -D$(KERNEL) $(INC_DIR)
LDFLAGS = -L$(LIB_DIR) -lpthread -lrt
AS = $(GNU_TOOLS)/$(AS_NAME)
CC = $(GNU_TOOLS)/$(GCC_NAME)
LD = $(GNU_TOOLS)/$(LD_NAME)
TARGETS = StartDiscovery
# += more TARGETS as you need em
CGI_TARGETS = $(patsubst %,$(CGI_DIR)/%,$(TARGETS) index.html)
OBJS = cgiI18N.o
OBJS += StartDiscovery.o
# += more OBJS as you need em
all: $(TARGETS)
StartDiscovery: StartDiscovery.o cgiDiscoveryLib.o cgiDaemonLib.o cgiI18N.o
$(CC) $(CFLAGS) $(LDFLAGS) StartDiscovery.o cgiDiscoveryLib.o
cgiDaemonLib.o cgiI18N.o -o StartDiscovery
StartDiscovery.o: $(WD_INCLUDE)/cgiDiscoveryLib.h $(WD_INCLUDE)/cgiDaemonLib.h
%.o: $(SRC_DIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
@rm -f $(OBJS)
clobber:
@rm -f $(OBJS) $(TARGETS)
install: $(CGI_TARGETS)
cp $(CGI_TARGETS) /usr/lib/cgi-bin
$(CGI_DIR)/%: %
sudo -u www-data cp $< $@
sudo -u www-data chmod g+w $@
uninstall:
@sudo -u www-data rm -f $(CGI_TARGETS)
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|